20 #ifndef SketchPlugin_ConstraintLength_H_
21 #define SketchPlugin_ConstraintLength_H_
23 #include "SketchPlugin.h"
24 #include "SketchPlugin_ConstraintBase.h"
25 #include "SketchPlugin_Sketch.h"
27 #include <GeomAPI_ICustomPrs.h>
46 inline static const std::string&
ID()
48 static const std::string MY_CONSTRAINT_LENGTH_ID(
"SketchConstraintLength");
49 return MY_CONSTRAINT_LENGTH_ID;
53 SKETCHPLUGIN_EXPORT
virtual const std::string&
getKind()
62 static const std::string MY_LOCATION_TYPE_ID(
"LocationType");
63 return MY_LOCATION_TYPE_ID;
67 SKETCHPLUGIN_EXPORT
virtual void execute();
72 SKETCHPLUGIN_EXPORT
virtual bool compute(
const std::string& theAttributeId);
78 SKETCHPLUGIN_EXPORT
virtual void colorConfigInfo(std::string& theSection, std::string& theName,
79 std::string& theDefault);
82 SKETCHPLUGIN_EXPORT
virtual AISObjectPtr
getAISObject(AISObjectPtr thePrevious);
99 std::shared_ptr<GeomAPI_Pnt>& thePoint1, std::shared_ptr<GeomAPI_Pnt>& thePoint2,
100 std::shared_ptr<GeomDataAPI_Point2D>& theStartPoint,
101 std::shared_ptr<GeomDataAPI_Point2D>& theEndPoint);
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Feature for creation of a new constraint between other features.
Definition: SketchPlugin_ConstraintBase.h:56
Feature for creation of a new constraint which defines a length of a line segment.
Definition: SketchPlugin_ConstraintLength.h:43
bool computeLenghtValue(double &theValue)
Computes distance between lenght point attributes.
Definition: SketchPlugin_ConstraintLength.cpp:124
static const std::string & LOCATION_TYPE_ID()
attribute name of dimension location type
Definition: SketchPlugin_ConstraintLength.h:60
virtual void execute()
Creates a new part document if needed.
Definition: SketchPlugin_ConstraintLength.cpp:73
virtual void colorConfigInfo(std::string &theSection, std::string &theName, std::string &theDefault)
Retuns the parameters of color definition in the resources config manager.
Definition: SketchPlugin_ConstraintLength.cpp:65
virtual void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_ConstraintLength.cpp:172
SketchPlugin_ConstraintLength()
Use plugin manager for features creation.
Definition: SketchPlugin_ConstraintLength.cpp:49
virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
Returns the AIS preview.
Definition: SketchPlugin_ConstraintLength.cpp:160
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: SketchPlugin_ConstraintLength.cpp:54
static const std::string & ID()
Length constraint kind.
Definition: SketchPlugin_ConstraintLength.h:46
virtual bool compute(const std::string &theAttributeId)
Computes the attribute value on the base of other attributes if the value can be computed.
Definition: SketchPlugin_ConstraintLength.cpp:99
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_ConstraintLength.h:53