1 // File: SketchPlugin_ConstraintRadius.h
2 // Created: 26 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_ConstraintRadius_H_
6 #define SketchPlugin_ConstraintRadius_H_
8 #include "SketchPlugin.h"
9 #include <SketchPlugin_Sketch.h>
10 #include "SketchPlugin_ConstraintBase.h"
12 #define RADIUS_COLOR "#ff00ff"
14 /** \class SketchPlugin_ConstraintRadius
16 * \brief Feature for creation of a new constraint which defines
17 * a radius of a circle or an arc of circle
19 * These constraint has two attributes:
20 * SketchPlugin_Constraint::VALUE() (radius), SketchPlugin_Constraint::ENTITY_A() (a circle)
22 class SketchPlugin_ConstraintRadius : public SketchPlugin_ConstraintBase
25 /// Radius constraint kind
26 inline static const std::string& ID()
28 static const std::string MY_CONSTRAINT_RADIUS_ID("SketchConstraintRadius");
29 return MY_CONSTRAINT_RADIUS_ID;
31 /// \brief Returns the kind of a feature
32 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
34 static std::string MY_KIND = SketchPlugin_ConstraintRadius::ID();
38 /// \brief Creates a new part document if needed
39 SKETCHPLUGIN_EXPORT virtual void execute();
41 /// \brief Request for initialization of data model of the feature: adding all attributes
42 SKETCHPLUGIN_EXPORT virtual void initAttributes();
44 /// Returns the AIS preview
45 SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious);
48 /// \param theDeltaX the delta for X coordinate is moved
49 /// \param theDeltaY the delta for Y coordinate is moved
50 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
52 /// \brief Use plugin manager for features creation
53 SketchPlugin_ConstraintRadius();