Salome HOME
Refactoring: static constants are replaced by inline functions in:
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintDistance.h
1 // File:    SketchPlugin_ConstraintDistance.h
2 // Created: 23 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintDistance_HeaderFile
6 #define SketchPlugin_ConstraintDistance_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_Constraint.h"
10 #include <SketchPlugin_Sketch.h>
11 #include <list>
12
13 /** \class SketchPlugin_ConstraintDistance
14  *  \ingroup DataModel
15  *  \brief Feature for creation of a new constraint which defines a distance
16  *         between a point and another feature (point, line, plane or face)
17  *
18  *  These constraint has three attributes:
19  *  SketchPlugin_Constraint::VALUE(), SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
20  */
21 class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
22 {
23 public:
24   /// Distance constraint kind
25   inline static const std::string& ID()
26   {
27     static const std::string MY_CONSTRAINT_DISTANCE_ID("SketchConstraintDistance");
28     return MY_CONSTRAINT_DISTANCE_ID;
29   }
30
31   /// \brief Returns the kind of a feature
32   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
33   {static std::string MY_KIND = SketchPlugin_ConstraintDistance::ID(); return MY_KIND;}
34
35   /// \brief Returns to which group in the document must be added feature
36   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
37   {static std::string MY_GROUP = SketchPlugin_Sketch::ID(); return MY_GROUP;}
38
39   /// \brief Creates a new part document if needed
40   SKETCHPLUGIN_EXPORT virtual void execute();
41
42   /// \brief Request for initialization of data model of the feature: adding all attributes
43   SKETCHPLUGIN_EXPORT virtual void initAttributes();
44
45   /// Returns the AIS preview
46   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
47                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
48
49   /// Moves the feature
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);
53
54   /// \brief Use plugin manager for features creation
55   SketchPlugin_ConstraintDistance();
56 };
57
58 #endif