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 /// Circle feature kind
13 const std::string SKETCH_CIRCLE_KIND("SketchCircle");
15 /// 2D point - center of the circle
16 const std::string CIRCLE_ATTR_CENTER("CircleCenter");
17 /// Radius of the circle
18 const std::string CIRCLE_ATTR_RADIUS("CircleRadius");
20 /**\class SketchPlugin_Circle
22 * \brief Feature for creation of the new circle in PartSet.
24 class SketchPlugin_Circle: public SketchPlugin_Feature
27 /// Returns the kind of a feature
28 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
29 {static std::string MY_KIND = SKETCH_CIRCLE_KIND; return MY_KIND;}
31 /// Returns to which group in the document must be added feature
32 SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
33 {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
35 /// Creates a new part document if needed
36 SKETCHPLUGIN_EXPORT virtual void execute();
38 /// Request for initialization of data model of the feature: adding all attributes
39 SKETCHPLUGIN_EXPORT virtual void initAttributes();
41 /// Returns the sketch preview
42 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
44 /// Adds sub-feature of the higher level feature (sub-element of the sketch)
45 /// \param theFeature sub-feature
46 SKETCHPLUGIN_EXPORT virtual const void addSub(
47 const FeaturePtr& theFeature) {};
50 /// \param theDeltaX the delta for X coordinate is moved
51 /// \param theDeltaY the delta for Y coordinate is moved
52 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
54 /// Return the distance between the feature and the point
55 /// \param thePoint the point
56 virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
58 /// Use plugin manager for features creation
59 SketchPlugin_Circle();