Salome HOME
c02c79e21941ce1838c581b9c9f69be80abd55bd
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Circle.h
1 // File:        SketchPlugin_Circle.h
2 // Created:     26 May 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef SketchPlugin_Circle_HeaderFile
6 #define SketchPlugin_Circle_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Feature.h>
10 #include <SketchPlugin_Sketch.h>
11
12 /// Circle feature kind
13 const std::string SKETCH_CIRCLE_KIND("SketchCircle");
14
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");
19
20 /**\class SketchPlugin_Circle
21  * \ingroup DataModel
22  * \brief Feature for creation of the new circle in PartSet.
23  */
24 class SketchPlugin_Circle: public SketchPlugin_Feature
25 {
26 public:
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;}
30
31   /// Creates a new part document if needed
32   SKETCHPLUGIN_EXPORT virtual void execute();
33
34   /// Request for initialization of data model of the feature: adding all attributes
35   SKETCHPLUGIN_EXPORT virtual void initAttributes();
36
37   /// Returns the AIS preview
38   virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
39                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious)
40   {return simpleAISObject(firstResult(), thePrevious);}
41
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 FeaturePtr& theFeature) {};
46
47   /// Moves the feature
48   /// \param theDeltaX the delta for X coordinate is moved
49   /// \param theDeltaY the delta for Y coordinate is moved
50   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
51
52   /// Return the distance between the feature and the point
53   /// \param thePoint the point
54   virtual double distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
55
56   /// Use plugin manager for features creation
57   SketchPlugin_Circle();
58 };
59
60 #endif