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>
13 /// Distance constraint kind
14 const std::string SKETCH_CONSTRAINT_DISTANCE_KIND("SketchConstraintDistance");
16 /** \class SketchPlugin_ConstraintDistance
18 * \brief Feature for creation of a new constraint which defines a distance
19 * between a point and another feature (point, line, plane or face)
21 * These constraint has three attributes:
22 * CONSTRAINT_ATTR_VALUE, CONSTRAINT_ATTR_ENTITY_A and CONSTRAINT_ATTR_ENTITY_B
24 class SketchPlugin_ConstraintDistance: public SketchPlugin_Constraint
27 /// \brief Returns the kind of a feature
28 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
29 {static std::string MY_KIND = SKETCH_CONSTRAINT_DISTANCE_KIND; return MY_KIND;}
31 /// \brief Returns to which group in the document must be added feature
32 SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
33 {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;}
35 /// \brief Creates a new part document if needed
36 SKETCHPLUGIN_EXPORT virtual void execute();
38 /// \brief Request for initialization of data model of the feature: adding all attributes
39 SKETCHPLUGIN_EXPORT virtual void initAttributes();
41 /// \brief Returns the sketch preview
42 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
44 /// \brief Use plugin manager for features creation
45 SketchPlugin_ConstraintDistance();