Salome HOME
Merge remote-tracking branch 'remotes/origin/SolveSpace'
[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 <list>
11
12 /// Start 2D point of the line
13 const std::string LINE_ATTR_START("StartPoint");
14 /// End 2D point of the line
15 const std::string LINE_ATTR_END("EndPoint");
16
17 /**\class SketchPlugin_Line
18  * \ingroup DataModel
19  * \brief Feature for creation of the new part in PartSet.
20  */
21 class SketchPlugin_Line: public SketchPlugin_Feature
22 {
23 public:
24   /// Returns the kind of a feature
25   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
26   {static std::string MY_KIND = "SketchLine"; return MY_KIND;}
27
28   /// Returns to which group in the document must be added feature
29   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
30   {static std::string MY_GROUP = "Sketch"; return MY_GROUP;}
31
32   /// Creates a new part document if needed
33   SKETCHPLUGIN_EXPORT virtual void execute();
34
35   /// Request for initialization of data model of the feature: adding all attributes
36   SKETCHPLUGIN_EXPORT virtual void initAttributes();
37
38   /// Returns the sketch preview
39   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
40
41   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
42   /// \param theFeature sub-feature
43   SKETCHPLUGIN_EXPORT virtual const void addSub(
44     const boost::shared_ptr<ModelAPI_Feature>& theFeature) {};
45
46   /// Use plugin manager for features creation
47   SketchPlugin_Line();
48 };
49
50 #endif