1 // File: SketchPlugin_Circle.h
2 // Created: 26 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_Circle_HeaderFile
6 #define SketchPlugin_Circle_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10 #include <SketchPlugin_Sketch.h>
12 /// 2D point - center of the circle
13 const std::string CIRCLE_ATTR_CENTER("CircleCenter");
14 /// Radius of the circle
15 const std::string CIRCLE_ATTR_RADIUS("CircleRadius");
17 /**\class SketchPlugin_Circle
19 * \brief Feature for creation of the new circle in PartSet.
21 class SketchPlugin_Circle: public SketchPlugin_Feature
24 /// Returns the kind of a feature
25 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
26 {static std::string MY_KIND = "SketchCircle"; 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_KIND; 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
47 SketchPlugin_Circle();