]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_Circle.h
Salome HOME
Merge branch 'Dev_0.6.1' of newgeom:newgeom into Dev_0.6.1
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Circle.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SketchPlugin_Circle.h
4 // Created:     26 May 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef SketchPlugin_Circle_H_
8 #define SketchPlugin_Circle_H_
9
10 #include "SketchPlugin.h"
11 #include <SketchPlugin_Feature.h>
12 #include <SketchPlugin_Sketch.h>
13 #include <GeomAPI_IPresentable.h>
14
15 /**\class SketchPlugin_Circle
16  * \ingroup DataModel
17  * \brief Feature for creation of the new circle in PartSet.
18  */
19 class SketchPlugin_Circle : public SketchPlugin_Feature  //, public GeomAPI_IPresentable
20 {
21  public:
22   /// Circle feature kind
23   inline static const std::string& ID()
24   {
25     static const std::string MY_CIRCLE_ID("SketchCircle");
26     return MY_CIRCLE_ID;
27   }
28
29   /// 2D point - center of the circle
30   inline static const std::string& CENTER_ID()
31   {
32     static const std::string MY_CIRCLE_CENTER_ID("CircleCenter");
33     return MY_CIRCLE_CENTER_ID;
34   }
35
36   /// Radius of the circle
37   inline static const std::string& RADIUS_ID()
38   {
39     static const std::string MY_CIRCLE_RADIUS_ID("CircleRadius");
40     return MY_CIRCLE_RADIUS_ID;
41   }
42
43   /// Returns the kind of a feature
44   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
45   {
46     static std::string MY_KIND = SketchPlugin_Circle::ID();
47     return MY_KIND;
48   }
49
50   /// Returns true is sketch element is under the rigid constraint
51   SKETCHPLUGIN_EXPORT virtual bool isFixed();
52
53   /// Creates a new part document if needed
54   SKETCHPLUGIN_EXPORT virtual void execute();
55
56   /// Request for initialization of data model of the feature: adding all attributes
57   SKETCHPLUGIN_EXPORT virtual void initAttributes();
58
59   /// Returns the AIS preview
60   virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
61   {
62     return simpleAISObject(firstResult(), thePrevious);
63   }
64
65   /// Adds sub-feature of the higher level feature (sub-element of the sketch)
66   /// \param theFeature sub-feature
67   SKETCHPLUGIN_EXPORT virtual const void addSub(const FeaturePtr& theFeature)
68   {
69   }
70   ;
71
72   /// Moves the feature
73   /// \param theDeltaX the delta for X coordinate is moved
74   /// \param theDeltaY the delta for Y coordinate is moved
75   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
76
77   /// Return the distance between the feature and the point
78   /// \param thePoint the point
79   virtual double distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
80
81   /// Called on change of any argument-attribute of this object
82   SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
83
84   /// Use plugin manager for features creation
85   SketchPlugin_Circle();
86 };
87
88 #endif