X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Events.h;h=a7718d1de11721eaa0106e359d2666d62bc4b776;hb=d32b7de5f466bcf611537140d7410c2b5c151c3c;hp=1d69e38a961c276967a8ebedb1c5b2e745eb2477;hpb=57199135053dfe0636ff8ff29eb6c75a6df6f08d;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Events.h b/src/ModelAPI/ModelAPI_Events.h index 1d69e38a9..a7718d1de 100644 --- a/src/ModelAPI/ModelAPI_Events.h +++ b/src/ModelAPI/ModelAPI_Events.h @@ -36,6 +36,7 @@ class ModelAPI_Document; class ModelAPI_ResultParameter; +class GeomAPI_Pnt2d; /// Event ID that feature is created (comes with ModelAPI_ObjectUpdatedMessage) static const char * EVENT_OBJECT_CREATED = "ObjectCreated"; @@ -467,4 +468,46 @@ private: int myDOF; }; +/// Message sent when feature or attrubute has been moved. +/// Stores the moving object/attribute, original and new positions of mouse. +class ModelAPI_ObjectMovedMessage : public Events_Message +{ + ObjectPtr myMovedObject; + AttributePtr myMovedAttribute; + + std::shared_ptr myOriginalPosition; + std::shared_ptr myCurrentPosition; + +public: + MODELAPI_EXPORT ModelAPI_ObjectMovedMessage(const void* theSender = 0); + + /// Set object which is being moved (if the message already contains attribute it will be cleared) + MODELAPI_EXPORT void setMovedObject(const ObjectPtr& theMovedObject); + /// Set attribute which is being moved (if the message already contains object it will be cleared) + MODELAPI_EXPORT void setMovedAttribute(const AttributePtr& theMovedAttribute); + + /// Return moved object + ObjectPtr movedObject() const + { return myMovedObject; } + /// Return moved attribute + AttributePtr movedAttribute() const + { return myMovedAttribute; } + + /// Set original mouse position + MODELAPI_EXPORT void setOriginalPosition(double theX, double theY); + /// Set original mouse position + MODELAPI_EXPORT void setOriginalPosition(const std::shared_ptr& thePoint); + /// Return original mouse position + const std::shared_ptr& originalPosition() const + { return myOriginalPosition; } + + /// Set current mouse position + MODELAPI_EXPORT void setCurrentPosition(double theX, double theY); + /// Set current mouse position + MODELAPI_EXPORT void setCurrentPosition(const std::shared_ptr& thePoint); + /// Return current mouse position + const std::shared_ptr& currentPosition() const + { return myCurrentPosition; } +}; + #endif