Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[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 /// Radius constraint kind
13 const std::string SKETCH_CONSTRAINT_RADIUS_KIND("SketchConstraintRadius");
14
15 /** \class SketchPlugin_ConstraintRadius
16  *  \ingroup DataModel
17  *  \brief Feature for creation of a new constraint which defines 
18  *         a radius of a circle or an arc of circle
19  *
20  *  These constraint has two attributes:
21  *  CONSTRAINT_ATTR_VALUE (radius), CONSTRAINT_ATTR_ENTITY_A (a circle)
22  */
23 class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
24 {
25 public:
26   /// \brief Returns the kind of a feature
27   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
28   {static std::string MY_KIND = SKETCH_CONSTRAINT_RADIUS_KIND; return MY_KIND;}
29
30   /// \brief Returns to which group in the document must be added feature
31   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
32   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
33
34   /// \brief Creates a new part document if needed
35   SKETCHPLUGIN_EXPORT virtual void execute();
36
37   /// \brief Request for initialization of data model of the feature: adding all attributes
38   SKETCHPLUGIN_EXPORT virtual void initAttributes();
39
40   /// Returns the AIS preview
41   SKETCHPLUGIN_EXPORT virtual Handle_AIS_InteractiveObject getAISShape(Handle_AIS_InteractiveObject thePrevious);
42
43   /// Moves the feature
44   /// \param theDeltaX the delta for X coordinate is moved
45   /// \param theDeltaY the delta for Y coordinate is moved
46   SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
47
48   /// \brief Use plugin manager for features creation
49   SketchPlugin_ConstraintRadius();
50 };
51
52 #endif