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