20 #ifndef SketchPlugin_ConstraintDistance_H_
21 #define SketchPlugin_ConstraintDistance_H_
23 #include "SketchPlugin.h"
24 #include "SketchPlugin_ConstraintBase.h"
25 #include "SketchPlugin_Sketch.h"
26 #include "ModelAPI_Data.h"
28 #include <GeomAPI_ICustomPrs.h>
47 inline static const std::string&
ID()
49 static const std::string MY_CONSTRAINT_DISTANCE_ID(
"SketchConstraintDistance");
50 return MY_CONSTRAINT_DISTANCE_ID;
54 SKETCHPLUGIN_EXPORT
virtual const std::string&
getKind()
61 inline static const std::string&
SIGNED()
63 static const std::string MY_SIGNED(
"SignedDistance");
71 static const std::string MY_DIRECTION_ID(
"DistanceDirection");
72 return MY_DIRECTION_ID;
78 static const std::string MY_LOCATION_TYPE_ID(
"LocationType");
79 return MY_LOCATION_TYPE_ID;
83 SKETCHPLUGIN_EXPORT
virtual void execute();
89 SKETCHPLUGIN_EXPORT
virtual void colorConfigInfo(std::string& theSection, std::string& theName,
90 std::string& theDefault);
93 SKETCHPLUGIN_EXPORT
virtual AISObjectPtr
getAISObject(AISObjectPtr thePrevious);
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 distance between a point and another feature...
Definition: SketchPlugin_ConstraintDistance.h:44
virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious)
Returns the AIS preview.
Definition: SketchPlugin_ConstraintDistance.cpp:102
static const std::string & DIRECTION_ID()
The direction from the first object to the second.
Definition: SketchPlugin_ConstraintDistance.h:69
virtual void execute()
Creates a new part document if needed.
Definition: SketchPlugin_ConstraintDistance.cpp:87
static const std::string & LOCATION_TYPE_ID()
attribute name of dimension location type
Definition: SketchPlugin_ConstraintDistance.h:76
static const std::string & ID()
Distance constraint kind.
Definition: SketchPlugin_ConstraintDistance.h:47
virtual void initAttributes()
Request for initialization of data model of the feature: adding all attributes.
Definition: SketchPlugin_ConstraintDistance.cpp:55
virtual void attributeChanged(const std::string &theID)
Called on change of any argument-attribute of this object.
Definition: SketchPlugin_ConstraintDistance.cpp:202
virtual void colorConfigInfo(std::string &theSection, std::string &theName, std::string &theDefault)
Returns the parameters of color definition in the resources config manager.
Definition: SketchPlugin_ConstraintDistance.cpp:78
SketchPlugin_ConstraintDistance()
Use plugin manager for features creation.
Definition: SketchPlugin_ConstraintDistance.cpp:49
virtual double calculateCurrentDistance()
Returns the current distance between the feature attributes.
Definition: SketchPlugin_ConstraintDistance.cpp:129
static const std::string & SIGNED()
Shows whether the point-line distance should keep its sign.
Definition: SketchPlugin_ConstraintDistance.h:61
virtual const std::string & getKind()
Returns the kind of a feature.
Definition: SketchPlugin_ConstraintDistance.h:54
bool areAttributesInitialized()
Check the attributes related to distanced points/features are initialized.
Definition: SketchPlugin_ConstraintDistance.cpp:176
bool myFlyoutUpdate
to avoid cyclic dependencies on automatic updates of flyout point
Definition: SketchPlugin_ConstraintDistance.h:110
Feature for creation of the new part in PartSet.
Definition: SketchPlugin_Line.h:38