1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SketchPlugin_SketchDrawer_H_
22 #define SketchPlugin_SketchDrawer_H_
24 #include "SketchPlugin.h"
25 #include <ModelAPI_Feature.h>
27 /// \class SketchPlugin_SketchDrawer
29 /// \brief Feature for creation of a sketch on selected base object and plane. It tries
30 /// to make sketch elements equal to edges and vertices of the objects that belong to
31 /// the selected plane.
32 class SketchPlugin_SketchDrawer: public ModelAPI_Feature
36 SketchPlugin_SketchDrawer();
39 inline static const std::string& ID()
41 static const std::string MY_FEATURE_ID("SketchDrawer");
45 /// Attribute name of the base shape selected.
46 inline static const std::string& BASE_ID()
48 static const std::string ID("base_shape");
51 /// Attribute name of the plane selected.
52 inline static const std::string& PLANE_ID()
54 static const std::string ID("plane");
58 /// \return the kind of a feature.
59 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
61 static std::string MY_KIND = SketchPlugin_SketchDrawer::ID();
65 /// Creates a new sketch.
66 SKETCHPLUGIN_EXPORT virtual void execute();
68 /// Request for initialization of data model of the feature: adding all attributes.
69 SKETCHPLUGIN_EXPORT virtual void initAttributes();
71 /// Reimplemented from ModelAPI_Feature::isMacro(). Means that feature is removed on apply.
73 SKETCHPLUGIN_EXPORT virtual bool isMacro() const {return true;}
75 /// No preview is generated until it is applied.
76 SKETCHPLUGIN_EXPORT virtual bool isPreviewNeeded() const {return false;}