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 /// Start 2D point of the line
16 const std::string SKETCH_CONSTRAINT_ATTR_CIRCLE_POINT("CirclePoint");
17
18
19 /** \class SketchPlugin_ConstraintRadius
20  *  \ingroup DataModel
21  *  \brief Feature for creation of a new constraint which defines 
22  *         a radius of a circle or an arc of circle
23  *
24  *  These constraint has two attributes:
25  *  CONSTRAINT_ATTR_VALUE (radius), CONSTRAINT_ATTR_ENTITY_A (a circle)
26  */
27 class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
28 {
29 public:
30   /// \brief Returns the kind of a feature
31   SKETCHPLUGIN_EXPORT virtual const std::string& getKind() 
32   {static std::string MY_KIND = SKETCH_CONSTRAINT_RADIUS_KIND; return MY_KIND;}
33
34   /// \brief Returns to which group in the document must be added feature
35   SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() 
36   {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
37
38   /// \brief Creates a new part document if needed
39   SKETCHPLUGIN_EXPORT virtual void execute();
40
41   /// \brief Request for initialization of data model of the feature: adding all attributes
42   SKETCHPLUGIN_EXPORT virtual void initAttributes();
43
44   /// \brief Returns the sketch preview
45   SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
46
47   /// \brief Use plugin manager for features creation
48   SketchPlugin_ConstraintRadius();
49 };
50
51 #endif