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>
10 #include <SketchPlugin_Sketch.h>
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");
18 /**\class SketchPlugin_Line
20 * \brief Feature for creation of the new part in PartSet.
22 class SketchPlugin_Line: public SketchPlugin_Feature
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;}
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;}
33 /// Creates a new part document if needed
34 SKETCHPLUGIN_EXPORT virtual void execute();
36 /// Request for initialization of data model of the feature: adding all attributes
37 SKETCHPLUGIN_EXPORT virtual void initAttributes();
39 /// Returns the sketch preview
40 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
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) {};
47 /// Use plugin manager for features creation