]> SALOME platform Git repositories - modules/shaper.git/blob - src/SketchPlugin/SketchPlugin_ConstraintDistance.h
Salome HOME
Working with Construction results in SketchPlugin
[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 /// Distance constraint kind
14 const std::string SKETCH_CONSTRAINT_DISTANCE_KIND("SketchConstraintDistance");
15
16 /** \class SketchPlugin_ConstraintDistance
17  *  \ingroup DataModel
18  *  \brief Feature for creation of a new constraint which defines a distance
19  *         between a point and another feature (point, line, plane or face)
20  *
21  *  These constraint has three attributes:
22  *  CONSTRAINT_ATTR_VALUE, CONSTRAINT_ATTR_ENTITY_A and CONSTRAINT_ATTR_ENTITY_B
23  */
24 class SketchPlugin_ConstraintDistance: 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_DISTANCE_KIND; return MY_KIND;}
30
31   /// \brief Creates a new part document if needed
32   SKETCHPLUGIN_EXPORT virtual void execute();
33
34   /// \brief Request for initialization of data model of the feature: adding all attributes
35   SKETCHPLUGIN_EXPORT virtual void initAttributes();
36
37   /// Returns the AIS preview
38   SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
39                                 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
40
41   /// Moves the feature
42   /// \param theDeltaX the delta for X coordinate is moved
43   /// \param theDeltaY the delta for Y coordinate is moved
44   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
45
46   /// \brief Use plugin manager for features creation
47   SketchPlugin_ConstraintDistance();
48 };
49
50 #endif