X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintLength.h;h=d6098af221cf8c12e60b629ff246c56b80c63a45;hb=74e9ba33303efc2282db1261706e904efa36b255;hp=98ef62511e619b47eb56a68815e70916e2962af6;hpb=72cb66f9c09b0f8fa224f6f8ab43548658015b49;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.h b/src/SketchPlugin/SketchPlugin_ConstraintLength.h index 98ef62511..d6098af22 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.h @@ -9,13 +9,14 @@ #include "SketchPlugin.h" #include "SketchPlugin_ConstraintBase.h" -#include +#include "SketchPlugin_Sketch.h" + +#include + #include class GeomDataAPI_Point2D; -#define LENGTH_COLOR "#ff00ff" - /** \class SketchPlugin_ConstraintLength * \ingroup Plugins * \brief Feature for creation of a new constraint which defines a length of a line segment @@ -24,7 +25,7 @@ class GeomDataAPI_Point2D; * SketchPlugin_Constraint::VALUE() (length) and SketchPlugin_Constraint::ENTITY_A() (segment), * SketchPlugin_Constraint::FLYOUT_VALUE_PNT() (distance of a constraints handle) */ -class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase +class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase, public GeomAPI_ICustomPrs { public: /// Length constraint kind @@ -43,6 +44,11 @@ class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase /// \brief Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute(); + /// Computes the attribute value on the base of other attributes if the value can be computed + /// \param theAttributeId an attribute index to be computed + /// \return a boolean value about it is computed + SKETCHPLUGIN_EXPORT virtual bool compute(const std::string& theAttributeId); + /// \brief Request for initialization of data model of the feature: adding all attributes SKETCHPLUGIN_EXPORT virtual void initAttributes(); @@ -58,6 +64,10 @@ class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase /// \param theID identifier of changed attribute SKETCHPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID); + /// Customize presentation of the feature + virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, + std::shared_ptr theDefaultPrs); + /// \brief Use plugin manager for features creation SketchPlugin_ConstraintLength(); @@ -67,6 +77,9 @@ private: std::shared_ptr& thePoint1, std::shared_ptr& thePoint2, std::shared_ptr& theStartPoint, std::shared_ptr& theEndPoint); + +private: + bool myFlyoutUpdate; ///< to avoid cyclic dependencies on automatic updates of flyout point }; #endif