1 // File: SketchPlugin_ConstraintRadius.h
2 // Created: 26 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_ConstraintRadius_HeaderFile
6 #define SketchPlugin_ConstraintRadius_HeaderFile
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_Constraint.h"
12 /** \class SketchPlugin_ConstraintRadius
14 * \brief Feature for creation of a new constraint which defines
15 * a radius of a circle or an arc of circle
17 * These constraint has two attributes:
18 * SketchPlugin_Constraint::VALUE() (radius), SketchPlugin_Constraint::ENTITY_A() (a circle)
20 class SketchPlugin_ConstraintRadius: public SketchPlugin_Constraint
23 /// Radius constraint kind
24 inline static const std::string& ID() {
25 static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
26 return MY_CONSTRAINT_RADIUS_ID;
28 /// \brief Returns the kind of a feature
29 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
30 {static std::string MY_KIND = SketchPlugin_ConstraintRadius::ID(); return MY_KIND;}
32 /// \brief Creates a new part document if needed
33 SKETCHPLUGIN_EXPORT virtual void execute();
35 /// \brief Request for initialization of data model of the feature: adding all attributes
36 SKETCHPLUGIN_EXPORT virtual void initAttributes();
38 /// Returns the AIS preview
39 SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
40 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
43 /// \param theDeltaX the delta for X coordinate is moved
44 /// \param theDeltaY the delta for Y coordinate is moved
45 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
47 /// \brief Use plugin manager for features creation
48 SketchPlugin_ConstraintRadius();