X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Constraint.h;h=dbb66522a715558218f6eeabd0c723d9c9d3d046;hb=1f2a62003cac25a91d8517f3af1940c774f10433;hp=98680830ae87b92b2152e7d2cb45b0ad72d4fd29;hpb=6d67df3511c8cc3518911419aea31c15bafd2a8d;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Constraint.h b/src/SketchPlugin/SketchPlugin_Constraint.h index 98680830a..dbb66522a 100644 --- a/src/SketchPlugin/SketchPlugin_Constraint.h +++ b/src/SketchPlugin/SketchPlugin_Constraint.h @@ -7,6 +7,7 @@ #include "SketchPlugin.h" #include "SketchPlugin_Feature.h" +#include #include #include #include @@ -25,6 +26,10 @@ */ /// The value parameter for the constraint const std::string CONSTRAINT_ATTR_VALUE("ConstraintValue"); +/// The 2D value parameter for the constraint +const std::string CONSTRAINT_ATTR_FLYOUT_VALUE_PNT("ConstraintFlyoutValuePnt"); +/// The value parameter for the constraint +const std::string CONSTRAINT_ATTR_FLYOUT_VALUE("ConstraintFlyoutValue"); /// First entity for the constraint const std::string CONSTRAINT_ATTR_ENTITY_A("ConstraintEntityA"); /// Second entity for the constraint @@ -48,19 +53,24 @@ const std::string CONSTRAINT_ATTRIBUTES[CONSTRAINT_ATTR_SIZE] = class SketchPlugin_Constraint: public SketchPlugin_Feature { public: - /// \brief Returns the kind of a feature - SKETCHPLUGIN_EXPORT virtual const std::string& getKind() - {static std::string MY_KIND = "SketchConstraint"; return MY_KIND;} - /// \brief Returns to which group in the document must be added feature SKETCHPLUGIN_EXPORT virtual const std::string& getGroup() - {static std::string MY_GROUP = "Sketch"; return MY_GROUP;} + {static std::string MY_GROUP = SKETCH_KIND; return MY_GROUP;} /** \brief Adds sub-feature of the higher level feature (sub-element of the sketch) * \param theFeature sub-feature */ SKETCHPLUGIN_EXPORT virtual const void addSub( - const boost::shared_ptr& theFeature) {} + const FeaturePtr& theFeature) {} + + /// Moves the feature + /// \param theDeltaX the delta for X coordinate is moved + /// \param theDeltaY the delta for Y coordinate is moved + SKETCHPLUGIN_EXPORT virtual void move(const double theDeltaX, const double theDeltaY) {}; + + /// Return the distance between the feature and the point + /// \param thePoint the point + virtual double distanceToPoint(const boost::shared_ptr& thePoint) { return 0; }; protected: /// \brief Use plugin manager for features creation