1 // File: SketchPlugin_Line.h
2 // Created: 24 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef SketchPlugin_Line_HeaderFile
6 #define SketchPlugin_Line_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
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");
17 /**\class SketchPlugin_Line
19 * \brief Feature for creation of the new part in PartSet.
21 class SketchPlugin_Line: public SketchPlugin_Feature
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;}
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;}
32 /// Creates a new part document if needed
33 SKETCHPLUGIN_EXPORT virtual void execute();
35 /// Request for initialization of data model of the feature: adding all attributes
36 SKETCHPLUGIN_EXPORT virtual void initAttributes();
38 /// Returns the sketch preview
39 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
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) {};
46 /// Use plugin manager for features creation