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"
13 /** \class SketchPlugin_ConstraintDistance
15 * \brief Feature for creation of a new constraint which defines a distance
16 * between a point and another feature (point, line, plane or face)
18 * These constraint has three attributes:
19 * CONSTRAINT_ATTR_VALUE, CONSTRAINT_ATTR_ENTITY_A and CONSTRAINT_ATTR_ENTITY_B
21 class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
24 /// \brief Returns the kind of a feature
25 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
26 {static std::string MY_KIND = "SketchConstraintDistance"; return MY_KIND;}
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"; return MY_GROUP;}
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 /// \brief Returns the sketch preview
39 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
41 /// \brief Use plugin manager for features creation
42 SketchPlugin_ConstraintDistance();