Salome HOME
bugfix for libSketchSolver.so: removing unresolved symbols from the SketchPlugin
[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_H_
6 #define SketchPlugin_ConstraintLength_H_
7
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_ConstraintBase.h"
10 #include <SketchPlugin_Sketch.h>
11 #include <list>
12
13 #define LENGTH_COLOR "#ff00ff"
14
15 /** \class SketchPlugin_ConstraintLength
16  *  \ingroup DataModel
17  *  \brief Feature for creation of a new constraint which defines a length of a line segment
18  *
19  *  These constraint has two attributes:
20  *  SketchPlugin_Constraint::VALUE() (length) and SketchPlugin_Constraint::ENTITY_A() (segment),
21  *  SketchPlugin_Constraint::FLYOUT_VALUE_PNT() (distance of a constraints handle)
22  */
23 class SketchPlugin_ConstraintLength: public SketchPlugin_ConstraintBase
24 {
25 public:
26   /// Length constraint kind
27   inline static const std::string& ID()
28   {
29     static const std::string MY_CONSTRAINT_LENGTH_ID("SketchConstraintLength");
30     return MY_CONSTRAINT_LENGTH_ID;
31   }
32   /// \brief Returns the kind of a feature
33   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
34   {static std::string MY_KIND = SketchPlugin_ConstraintLength::ID(); return MY_KIND;}
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 AISObjectPtr getAISObject(AISObjectPtr thePrevious);
44
45   /// Moves the feature
46   /// \param theDeltaX the delta for X coordinate is moved
47   /// \param theDeltaY the delta for Y coordinate is moved
48   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
49
50   /// \brief Use plugin manager for features creation
51   SketchPlugin_ConstraintLength();
52 };
53
54 #endif