Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintLength.h
1 // File:    SketchPlugin_ConstraintLength.h
2 // Created: 30 May 2014
3 // Author:  Artem ZHIDKOV
4
5 #ifndef SketchPlugin_ConstraintLength_HeaderFile
6 #define SketchPlugin_ConstraintLength_HeaderFile
7
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_Constraint.h"
10 #include <SketchPlugin_Sketch.h>
11 #include <list>
12
13 /// Length constraint kind
14 const std::string SKETCH_CONSTRAINT_LENGTH_KIND("SketchConstraintLength");
15
16 /** \class SketchPlugin_ConstraintLength
17  *  \ingroup DataModel
18  *  \brief Feature for creation of a new constraint which defines a length of a line segment
19  *
20  *  These constraint has two attributes:
21  *  CONSTRAINT_ATTR_VALUE (length) and CONSTRAINT_ATTR_ENTITY_A (segment),
22  *  CONSTRAINT_ATTR_FLYOUT_VALUE (distance of a constraints handle)
23  */
24 class SketchPlugin_ConstraintLength: public SketchPlugin_Constraint
25 {
26 public:
27   /// \brief Returns the kind of a feature
28   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
29   {static std::string MY_KIND = SKETCH_CONSTRAINT_LENGTH_KIND; return MY_KIND;}
30
31   /// \brief 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;}
34
35   /// \brief Creates a new part document if needed
36   SKETCHPLUGIN_EXPORT virtual void execute();
37
38   /// \brief Request for initialization of data model of the feature: adding all attributes
39   SKETCHPLUGIN_EXPORT virtual void initAttributes();
40
41   /// \brief Returns the sketch preview
42   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
43
44   /// Moves the feature
45   /// \param theDeltaX the delta for X coordinate is moved
46   /// \param theDeltaY the delta for Y coordinate is moved
47   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
48
49   /// \brief Use plugin manager for features creation
50   SketchPlugin_ConstraintLength();
51 };
52
53 #endif