Salome HOME
Refactoring: static constants are replaced by inline functions in:
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintRadius.h
1 // File:    SketchPlugin_ConstraintRadius.h
2 // Created: 26 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintRadius_HeaderFile
6 #define SketchPlugin_ConstraintRadius_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Constraint.h"
11
12 /** \class SketchPlugin_ConstraintRadius
13  *  \ingroup DataModel
14  *  \brief Feature for creation of a new constraint which defines 
15  *         a radius of a circle or an arc of circle
16  *
17  *  These constraint has two attributes:
18  *  SketchPlugin_Constraint::VALUE() (radius), SketchPlugin_Constraint::ENTITY_A() (a circle)
19  */
20 class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
21 {
22 public:
23   /// Radius constraint kind
24   inline static const std::string& ID() {
25     static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
26     return MY_CONSTRAINT_RADIUS_ID;
27   }
28   /// \brief Returns the kind of a feature
29   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
30   {static std::string MY_KIND = SketchPlugin_ConstraintRadius::ID(); return MY_KIND;}
31
32   /// \brief Returns to which group in the document must be added feature
33   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
34   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
35
36   /// \brief Creates a new part document if needed
37   SKETCHPLUGIN_EXPORT virtual void execute();
38
39   /// \brief Request for initialization of data model of the feature: adding all attributes
40   SKETCHPLUGIN_EXPORT virtual void initAttributes();
41
42   /// Returns the AIS preview
43   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
44                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
45
46   /// Moves the feature
47   /// \param theDeltaX the delta for X coordinate is moved
48   /// \param theDeltaY the delta for Y coordinate is moved
49   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
50
51   /// \brief Use plugin manager for features creation
52   SketchPlugin_ConstraintRadius();
53 };
54
55 #endif