1 // File: SketchPlugin_ConstraintLength.h
2 // Created: 30 May 2014
3 // Author: Artem ZHIDKOV
5 #ifndef SketchPlugin_ConstraintLength_HeaderFile
6 #define SketchPlugin_ConstraintLength_HeaderFile
8 #include "SketchPlugin.h"
9 #include "SketchPlugin_Constraint.h"
13 /** \class SketchPlugin_ConstraintLength
15 * \brief Feature for creation of a new constraint which defines a length of a line segment
17 * These constraint has two attributes:
18 * CONSTRAINT_ATTR_VALUE (length) and CONSTRAINT_ATTR_ENTITY_A (segment)
20 class SketchPlugin_ConstraintLength: public SketchPlugin_Constraint
23 /// \brief Returns the kind of a feature
24 SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
25 {static std::string MY_KIND = "SketchConstraintLength"; return MY_KIND;}
27 /// \brief Returns to which group in the document must be added feature
28 SKETCHPLUGIN_EXPORT virtual const std::string& getGroup()
29 {static std::string MY_GROUP = "Sketch"; return MY_GROUP;}
31 /// \brief Creates a new part document if needed
32 SKETCHPLUGIN_EXPORT virtual void execute();
34 /// \brief Request for initialization of data model of the feature: adding all attributes
35 SKETCHPLUGIN_EXPORT virtual void initAttributes();
37 /// \brief Returns the sketch preview
38 SKETCHPLUGIN_EXPORT virtual const boost::shared_ptr<GeomAPI_Shape>& preview();
40 /// \brief Use plugin manager for features creation
41 SketchPlugin_ConstraintLength();