1 // File: SketchPlugin_ConstraintDistance.h
2 // Created: 23 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_ConstraintDistance_HeaderFile
6 #define SketchPlugin_ConstraintDistance_HeaderFile
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_Constraint.h"
10 #include "SketchPlugin_Sketch.h"
14 /** \class SketchPlugin_ConstraintDistance
16 * \brief Feature for creation of a new constraint which defines a distance
17 * between a point and another feature (point, line, plane or face)
19 * These constraint has three attributes:
20 * SketchPlugin_Constraint::VALUE(), SketchPlugin_Constraint::ENTITY_A() and SketchPlugin_Constraint::ENTITY_B()
22 class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
25 /// Distance constraint kind
26 inline static const std::string& ID()
28 static const std::string MY_CONSTRAINT_DISTANCE_ID("SketchConstraintDistance");
29 return MY_CONSTRAINT_DISTANCE_ID;
32 /// \brief Returns the kind of a feature
33 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
34 {static std::string MY_KIND = SketchPlugin_ConstraintDistance::ID(); return MY_KIND;}
36 /// \brief Creates a new part document if needed
37 SKETCHPLUGIN_EXPORT virtual void execute();
39 /// \brief Request for initialization of data model of the feature: adding all attributes
40 SKETCHPLUGIN_EXPORT virtual void initAttributes();
42 /// Returns the AIS preview
43 SKETCHPLUGIN_EXPORT virtual boost::shared_ptr<GeomAPI_AISObject> getAISObject(
44 boost::shared_ptr<GeomAPI_AISObject> thePrevious);
47 /// \param theDeltaX the delta for X coordinate is moved
48 /// \param theDeltaY the delta for Y coordinate is moved
49 SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY);
51 /// \brief Use plugin manager for features creation
52 SketchPlugin_ConstraintDistance();