]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Line.h
Salome HOME
It replaces using of direct value "Sketch" to SKETCH_KIND, which is defined in the...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Line.h
1 // File:        SketchPlugin_Line.h
2 // Created:     24 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef SketchPlugin_Line_HeaderFile
6 #define SketchPlugin_Line_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10 #include <SketchPlugin_Sketch.h>
11 #include <list>
12
13 /// Start 2D point of the line
14 const std::string LINE_ATTR_START("StartPoint");
15 /// End 2D point of the line
16 const std::string LINE_ATTR_END("EndPoint");
17
18 /**\class SketchPlugin_Line
19  * \ingroup DataModel
20  * \brief Feature for creation of the new part in PartSet.
21  */
22 class SketchPlugin_Line: public SketchPlugin_Feature
23 {
24 public:
25   /// Returns the kind of a feature
26   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
27   {static std::string MY_KIND = "SketchLine"; return MY_KIND;}
28
29   /// Returns to which group in the document must be added feature
30   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
31   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
32
33   /// Creates a new part document if needed
34   SKETCHPLUGIN_EXPORT virtual void execute();
35
36   /// Request for initialization of data model of the feature: adding all attributes
37   SKETCHPLUGIN_EXPORT virtual void initAttributes();
38
39   /// Returns the sketch preview
40   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
41
42   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
43   /// \param theFeature sub-feature
44   SKETCHPLUGIN_EXPORT virtual const void addSub(
45     const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
46
47   /// Use plugin manager for features creation
48   SketchPlugin_Line();
49 };
50
51 #endif