]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModelAPI/ModelAPI_Events.h
Salome HOME
Get rid of compilation warnings. Part I.
[modules/shaper.git] / src / ModelAPI / ModelAPI_Events.h
1 // Copyright (C) 2014-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef MODELAPI_EVENTS_H_
21 #define MODELAPI_EVENTS_H_
22
23 #include <ModelAPI.h>
24 #include <ModelAPI_Object.h>
25 #include <ModelAPI_Feature.h>
26 #include <ModelAPI_Attribute.h>
27 #include <Events_MessageGroup.h>
28 #include <Events_Loop.h>
29
30 #include <memory>
31 #include <string>
32 #include <set>
33 #include <map>
34
35
36 class ModelAPI_Document;
37 class ModelAPI_ResultParameter;
38 class GeomAPI_Pnt2d;
39
40 #if defined __GNUC__ || defined __clang__
41 #define MAYBE_UNUSED __attribute__((unused))
42 #else
43 #define MAYBE_UNUSED
44 #endif
45
46 /// Event ID that feature is created (comes with ModelAPI_ObjectUpdatedMessage)
47 MAYBE_UNUSED static const char * EVENT_OBJECT_CREATED = "ObjectCreated";
48 /// Event ID that data of feature is updated (comes with Model_ObjectUpdatedMessage)
49 MAYBE_UNUSED static const char * EVENT_OBJECT_UPDATED = "ObjectUpdated";
50 /// Event ID that data of feature is deleted (comes with Model_ObjectDeletedMessage)
51 MAYBE_UNUSED static const char * EVENT_OBJECT_DELETED = "ObjectDeleted";
52 /// Event ID that name of feature is changed (comes with Model_ObjectRenamedMessage)
53 MAYBE_UNUSED static const char * EVENT_OBJECT_RENAMED = "ObjectRenamed";
54 /// Event ID that data of feature is updated (comes with ModelAPI_ObjectUpdatedMessage)
55 MAYBE_UNUSED static const char * EVENT_OBJECT_MOVED = "ObjectsMoved";
56 /// Event ID that visualization must be redisplayed (comes with ModelAPI_ObjectUpdatedMessage)
57 MAYBE_UNUSED static const char * EVENT_OBJECT_TO_REDISPLAY = "ObjectsToRedisplay";
58 /// Event ID that plugin is loaded (comes with ModelAPI_ObjectUpdatedMessage)
59 MAYBE_UNUSED static const char * EVENT_PLUGIN_LOADED = "PluginLoaded";
60 /// The active document becomes another one
61 MAYBE_UNUSED static const char * EVENT_DOCUMENT_CHANGED = "CurrentDocumentChanged";
62
63 /// Event ID that order of objects in group is changed,
64 /// so, tree must be fully recreated (movement of feature)
65 MAYBE_UNUSED static const char * EVENT_ORDER_UPDATED = "OrderUpdated";
66 /// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed
67 MAYBE_UNUSED static const char * EVENT_UPDATE_SELECTION = "UpdateSelection";
68
69 /// Request for the enabled/disabled actions behavior for some specific features
70 MAYBE_UNUSED static const char * EVENT_FEATURE_STATE_REQUEST = "FeatureStateRequest";
71 /// Reply for the enabled/disabled actions behavior for some specific features
72 MAYBE_UNUSED static const char * EVENT_FEATURE_STATE_RESPONSE = "FeatureStateResponse";
73
74 /// To block the viewer updates
75 MAYBE_UNUSED static const char * EVENT_UPDATE_VIEWER_BLOCKED = "UpdateViewerBlocked";
76 /// To unblock the viewer updates
77 MAYBE_UNUSED static const char * EVENT_UPDATE_VIEWER_UNBLOCKED = "UpdateViewerUnblocked";
78
79 /// To inform that there is an empty presentation in the viewer
80 MAYBE_UNUSED static const char * EVENT_EMPTY_AIS_PRESENTATION = "EmptyAISPresentation";
81 /// To inform that there is an empty operation for presentation in the viewer
82 MAYBE_UNUSED static const char * EVENT_EMPTY_OPERATION_PRESENTATION = "EmptyOperationPresentation";
83 /// To block preview
84 MAYBE_UNUSED static const char * EVENT_PREVIEW_BLOCKED = "PreviewBlocked";
85 /// To preview the current feature in the viewer (to compute the result)
86 MAYBE_UNUSED static const char * EVENT_PREVIEW_REQUESTED = "PreviewRequested";
87 /// To block automatic recomputation of any feature (by the GUI button press)
88 MAYBE_UNUSED static const char * EVENT_AUTOMATIC_RECOMPUTATION_DISABLE = "DisableAutomaticRecomputation";
89 /// To unblock block automatic recomputation (default state: the GUI button unpressed)
90 MAYBE_UNUSED static const char * EVENT_AUTOMATIC_RECOMPUTATION_ENABLE = "EnableAutomaticRecomputation";
91
92 /// Event ID that solver has conflicting constraints (comes with ModelAPI_SolverFailedMessage)
93 MAYBE_UNUSED static const char * EVENT_SOLVER_FAILED = "SolverFailed";
94 /// Event ID that the problem in solver disappeared
95 MAYBE_UNUSED static const char * EVENT_SOLVER_REPAIRED = "SolverRepaired";
96
97 /// Event Id that sketch has DoF = 0
98 MAYBE_UNUSED static const char * EVENT_SKETCH_FULLY_CONSTRAINED = "SketchFullyConstrainted";
99 /// Event Id that sketch has DoF > 0
100 MAYBE_UNUSED static const char * EVENT_SKETCH_UNDER_CONSTRAINED = "SketchUnderConstrainted";
101 /// Event Id that sketch has DoF < 0
102 MAYBE_UNUSED static const char * EVENT_SKETCH_OVER_CONSTRAINED  = "SketchOverConstrainted";
103
104 /// Event ID that informs that some object has changed the stability
105 MAYBE_UNUSED static const char * EVENT_STABILITY_CHANGED = "StabilityChanged";
106
107 /// Event ID that the sketch is prepared and all grouped messages for the solver may be flushed
108 MAYBE_UNUSED static const char * EVENT_SKETCH_PREPARED = "SketchPrepared";
109
110 /// Event ID that provides a request for list of non-fixed objects necessary for DoF = 0
111 MAYBE_UNUSED static const char * EVENT_GET_DOF_OBJECTS = "GetDoFObjects";
112
113 /// Event ID that provides a request for list of non-fixed objects necessary for DoF = 0
114 MAYBE_UNUSED static const char * EVENT_DOF_OBJECTS = "DoFObjects";
115
116 /// Event ID that requests updates visual attributes for presentations
117 MAYBE_UNUSED static const char * EVENT_VISUAL_ATTRIBUTES = "UpdateVisualAttributes";
118
119
120 /// Message that feature was changed (used for Object Browser update): moved, updated and deleted
121 class MODELAPI_EXPORT ModelAPI_ObjectUpdatedMessage : public Events_MessageGroup
122 {
123  protected:
124   /// Creates an empty message
125   ModelAPI_ObjectUpdatedMessage(const Events_ID theID, const void* theSender = 0);
126   /// The virtual destructor
127   virtual ~ModelAPI_ObjectUpdatedMessage();
128
129  public:
130   /// Returns the feature that has been updated
131   virtual const std::set<ObjectPtr>& objects() const = 0;
132
133   //! Creates a new empty group (to store it in the loop before flush)
134   virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
135
136   //! Allows to join the given message with the current one
137   virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined) = 0;
138 };
139
140 /// Message that feature was deleted (used for Object Browser update)
141 class MODELAPI_EXPORT ModelAPI_ObjectDeletedMessage : public Events_MessageGroup
142 {
143 protected:
144   /// Creates an empty message
145   ModelAPI_ObjectDeletedMessage(const Events_ID theID, const void* theSender = 0);
146   /// The virtual destructor
147   virtual ~ModelAPI_ObjectDeletedMessage();
148
149 public:
150   /// Returns the groups where the objects were deleted
151   virtual const std::list<std::pair<std::shared_ptr<ModelAPI_Document>, std::string> >&
152     groups() const = 0;
153
154   /// Creates the new empty message of this kind
155   virtual std::shared_ptr<Events_MessageGroup> newEmpty() = 0;
156
157   /// Returns the identifier of the kind of a message
158   virtual const Events_ID messageId() = 0;
159
160   /// Appends to this message the given one.
161   virtual void Join(const std::shared_ptr<Events_MessageGroup>& theJoined) = 0;
162 };
163
164 /// Message that order changed (used for Object Browser update)
165 class MODELAPI_EXPORT ModelAPI_OrderUpdatedMessage : public Events_Message
166 {
167 protected:
168   /// Creates a message:
169   ModelAPI_OrderUpdatedMessage(const Events_ID theID, const void* theSender = 0);
170   /// The virtual destructor
171   virtual ~ModelAPI_OrderUpdatedMessage();
172
173 public:
174   /// Returns the document that has been updated
175   virtual std::shared_ptr<ModelAPI_Feature> reordered() = 0;
176
177   /// Returns the identifier of the kind of a message
178   virtual const Events_ID messageId() = 0;
179 };
180
181 /// Allows to create ModelAPI messages
182 class MODELAPI_EXPORT ModelAPI_EventCreator
183 {
184 public:
185   virtual ~ModelAPI_EventCreator() {}
186
187   /// creates created, updated or moved messages and sends to the loop
188   virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent,
189                            const bool isGroupped = true) const = 0;
190   /// creates created, updated or moved messages with the objects collection and sends to the loop
191   virtual void sendUpdated(const std::list<ObjectPtr>& theObjects, const Events_ID& theEvent,
192     const bool isGroupped = true) const = 0;
193   /// creates deleted message and sends to the loop
194   virtual void sendDeleted(const std::shared_ptr<ModelAPI_Document>& theDoc,
195                            const std::string& theGroup) const = 0;
196   /// creates reordered message and sends to the loop
197   virtual void sendReordered(const std::shared_ptr<ModelAPI_Feature>& theReordered) const = 0;
198
199   /// returns the creator instance
200   static const ModelAPI_EventCreator* get();
201
202   /// sets the creator instance
203   static void set(const ModelAPI_EventCreator* theCreator);
204 };
205
206 /// Contains the state information about the feature: is it enabled or disabled.
207 class ModelAPI_FeatureStateMessage : public Events_Message
208 {
209 public:
210   /// Creates an empty message
211   MODELAPI_EXPORT ModelAPI_FeatureStateMessage(const Events_ID theID, const void* theSender = 0);
212   /// The virtual destructor
213   MODELAPI_EXPORT virtual ~ModelAPI_FeatureStateMessage();
214
215   /// Returns the feature this message is related to
216   MODELAPI_EXPORT std::shared_ptr<ModelAPI_Feature> feature() const;
217   /// Stores the feature this message is related to
218   MODELAPI_EXPORT void setFeature(std::shared_ptr<ModelAPI_Feature>& theFeature);
219   // For response
220   /// Returns true if feature has specific state
221   MODELAPI_EXPORT bool hasState(const std::string& theFeatureId) const;
222   /// Returns true if feature is enabled
223   MODELAPI_EXPORT bool state(const  std::string& theFeatureId, bool theDefault = false) const;
224   /// Stores the feature state
225   MODELAPI_EXPORT void setState(const std::string& theFeatureId, bool theValue);
226   /// Returns all feature IDs with states
227   MODELAPI_EXPORT std::list<std::string> features() const;
228
229  private:
230   /// For Request
231   std::shared_ptr<ModelAPI_Feature> myCurrentFeature;
232   /// For response
233   std::map<std::string, bool> myFeatureState;
234 };
235
236 /// Message that document (Part, PartSet) was created
237 class ModelAPI_DocumentCreatedMessage : public Events_Message
238 {
239   DocumentPtr myDocument;
240
241  public:
242   /// Creates an empty message
243   MODELAPI_EXPORT ModelAPI_DocumentCreatedMessage(const Events_ID theID, const void* theSender = 0);
244   /// The virtual destructor
245   MODELAPI_EXPORT virtual ~ModelAPI_DocumentCreatedMessage();
246   /// Static. Returns EventID of the message.
247   MODELAPI_EXPORT static Events_ID eventId()
248   {
249     static const char * MY_DOCUMENT_CREATED_EVENT_ID("DocumentCreated");
250     return Events_Loop::eventByName(MY_DOCUMENT_CREATED_EVENT_ID);
251   }
252
253   /// Returns a document stored in the message
254   MODELAPI_EXPORT DocumentPtr document() const;
255   /// Sets a document to the message
256   MODELAPI_EXPORT void setDocument(DocumentPtr theDocument);
257 };
258
259 /// Message that attribute text should be evaluated in the attribute value
260 class ModelAPI_AttributeEvalMessage : public Events_Message
261 {
262   AttributePtr myAttribute;
263
264  public:
265   /// Static. Returns EventID of the message.
266   MODELAPI_EXPORT static Events_ID& eventId()
267   {
268     static const char * MY_ATTRIBUTE_EVALUATION_EVENT_ID("AttributeEvaluationRequest");
269     static Events_ID anId = Events_Loop::eventByName(MY_ATTRIBUTE_EVALUATION_EVENT_ID);
270     return anId;
271   }
272
273   /// Useful method that creates and sends the AttributeEvalMessage event
274   MODELAPI_EXPORT static void send(AttributePtr theAttribute, const void* theSender)
275   {
276     std::shared_ptr<ModelAPI_AttributeEvalMessage> aMessage =
277       std::shared_ptr<ModelAPI_AttributeEvalMessage>(
278       new ModelAPI_AttributeEvalMessage(eventId(), theSender));
279     aMessage->setAttribute(theAttribute);
280     Events_Loop::loop()->send(aMessage);
281   }
282
283   /// Creates an empty message
284   MODELAPI_EXPORT ModelAPI_AttributeEvalMessage(const Events_ID theID, const void* theSender = 0);
285   /// The virtual destructor
286   MODELAPI_EXPORT virtual ~ModelAPI_AttributeEvalMessage();
287
288   /// Returns a document stored in the message
289   MODELAPI_EXPORT AttributePtr attribute() const;
290   /// Sets an attribute to the message
291   MODELAPI_EXPORT void setAttribute(AttributePtr theAttribute);
292 };
293
294 /// Message that parameter feature expression should be evaluated: value and error producing
295 class ModelAPI_ParameterEvalMessage : public Events_Message
296 {
297   FeaturePtr myParam; ///< parameters that should be evaluated
298   bool myIsProcessed; ///< true if results were set
299   /// result of processing, list of parameters in expression found
300   std::list<std::shared_ptr<ModelAPI_ResultParameter> > myParamsList;
301   double myResult; ///< result of processing, the computed value of the expression
302   std::string myError; ///< error of processing, empty if there is no error
303
304  public:
305   /// Static. Returns EventID of the message.
306   MODELAPI_EXPORT static Events_ID& eventId()
307   {
308     static const char * MY_PARAMETER_EVALUATION_EVENT_ID("ParameterEvaluationRequest");
309     static Events_ID anId = Events_Loop::eventByName(MY_PARAMETER_EVALUATION_EVENT_ID);
310     return anId;
311   }
312
313   /// Useful method that creates and sends the event.
314   /// Returns the message, processed, with the resulting fields filled.
315   MODELAPI_EXPORT static std::shared_ptr<ModelAPI_ParameterEvalMessage>
316     send(FeaturePtr theParameter, const void* theSender)
317   {
318     std::shared_ptr<ModelAPI_ParameterEvalMessage> aMessage =
319       std::shared_ptr<ModelAPI_ParameterEvalMessage>(
320       new ModelAPI_ParameterEvalMessage(eventId(), theSender));
321     aMessage->setParameter(theParameter);
322     Events_Loop::loop()->send(aMessage);
323     return aMessage;
324   }
325
326   /// Creates an empty message
327   MODELAPI_EXPORT ModelAPI_ParameterEvalMessage(const Events_ID theID, const void* theSender = 0);
328   /// The virtual destructor
329   MODELAPI_EXPORT virtual ~ModelAPI_ParameterEvalMessage();
330
331   /// Returns a parameter stored in the message
332   MODELAPI_EXPORT FeaturePtr parameter() const;
333   /// Sets a parameter to the message
334   MODELAPI_EXPORT void setParameter(FeaturePtr theParam);
335   /// Sets the results of processing
336   MODELAPI_EXPORT void setResults(
337     const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& theParamsList,
338     const double theResult, const std::string& theError);
339   /// Returns true if the expression is processed
340   MODELAPI_EXPORT bool isProcessed();
341   /// Returns the results of processing: list of parameters found in the expression
342   MODELAPI_EXPORT const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& params() const;
343   /// Returns the expression result
344   MODELAPI_EXPORT const double& result() const;
345   /// Returns the interpreter error (empty if no error)
346   MODELAPI_EXPORT const std::string& error() const;
347 };
348
349
350 /// Message to ask compute the positions of parameters in the expression
351 class ModelAPI_ComputePositionsMessage : public Events_Message
352 {
353   std::string myExpression; ///< the expression string
354   std::string myParamName; ///< name of the parameter to be searched
355   std::list<std::pair<int, int> > myPositions; ///< computation result: start-end position indices
356
357 public:
358   /// Static. Returns EventID of the message.
359   MODELAPI_EXPORT static Events_ID& eventId()
360   {
361     static const char * MY_COMPUTE_POSITIOND_EVENT_ID("ComputePositionsRequest");
362     static Events_ID anId = Events_Loop::eventByName(MY_COMPUTE_POSITIOND_EVENT_ID);
363     return anId;
364   }
365
366   /// Useful method that creates and sends the AttributeEvalMessage event
367   /// Returns the message, processed, with the resulting fields filled
368   MODELAPI_EXPORT static std::shared_ptr<ModelAPI_ComputePositionsMessage>
369     send(const std::string& theExpression, const std::string& theParameter, const void* theSender)
370   {
371     std::shared_ptr<ModelAPI_ComputePositionsMessage> aMessage =
372       std::shared_ptr<ModelAPI_ComputePositionsMessage>(
373       new ModelAPI_ComputePositionsMessage(eventId(), theSender));
374     aMessage->set(theExpression, theParameter);
375     Events_Loop::loop()->send(aMessage);
376     return aMessage;
377   }
378
379   /// Creates an empty message
380   MODELAPI_EXPORT ModelAPI_ComputePositionsMessage(
381     const Events_ID theID, const void* theSender = 0);
382   /// The virtual destructor
383   MODELAPI_EXPORT virtual ~ModelAPI_ComputePositionsMessage();
384
385   /// Returns an expression stored in the message
386   MODELAPI_EXPORT const std::string& expression() const;
387   /// Returns a parameter name stored in the message
388   MODELAPI_EXPORT const std::string& parameter() const;
389   /// Sets an expression and parameter needed for computation
390   MODELAPI_EXPORT void set(const std::string& theExpression, const std::string& theParameter);
391   /// Sets the results of processing
392   MODELAPI_EXPORT void setPositions(const std::list<std::pair<int, int> >& thePositions);
393   /// Returns the results of processing: position start and end indices
394   MODELAPI_EXPORT const std::list<std::pair<int, int> >& positions() const;
395 };
396
397 /// Message that the object is renamed
398 class ModelAPI_ObjectRenamedMessage : public Events_Message
399 {
400   ObjectPtr myObject;
401   std::string myOldName;
402   std::string myNewName;
403
404  public:
405   /// Static. Returns EventID of the message.
406   MODELAPI_EXPORT static Events_ID& eventId()
407   {
408     static const char * MY_OBJECT_RENAMED_EVENT_ID("ObjectRenamed");
409     static Events_ID anId = Events_Loop::eventByName(MY_OBJECT_RENAMED_EVENT_ID);
410     return anId;
411   }
412
413   /// Useful method that creates and sends the AttributeEvalMessage event
414   MODELAPI_EXPORT static void send(ObjectPtr theObject,
415                                    const std::string& theOldName,
416                                    const std::string& theNewName,
417                                    const void* theSender);
418
419   /// Creates an empty message
420   MODELAPI_EXPORT ModelAPI_ObjectRenamedMessage(const Events_ID theID, const void* theSender = 0);
421   /// The virtual destructor
422   MODELAPI_EXPORT virtual ~ModelAPI_ObjectRenamedMessage();
423
424   /// Returns an object
425   MODELAPI_EXPORT ObjectPtr object() const;
426   /// Sets an object
427   MODELAPI_EXPORT void setObject(ObjectPtr theObject);
428   /// Returns an old name
429   MODELAPI_EXPORT std::string oldName() const;
430   /// Sets an old name
431   MODELAPI_EXPORT void setOldName(const std::string& theOldName);
432   /// Returns a new name
433   MODELAPI_EXPORT std::string newName() const;
434   /// Sets a new name
435   MODELAPI_EXPORT void setNewName(const std::string& theNewName);
436 };
437
438 /// Message that the parameter should be replaced with its value
439 class ModelAPI_ReplaceParameterMessage : public Events_Message
440 {
441   ObjectPtr myObject;
442
443  public:
444   /// Static. Returns EventID of the message.
445   MODELAPI_EXPORT static Events_ID& eventId()
446   {
447     static const char * MY_EVENT_ID("ReplaceParameter");
448     static Events_ID anId = Events_Loop::eventByName(MY_EVENT_ID);
449     return anId;
450   }
451
452   /// Useful method that creates and sends the AttributeEvalMessage event
453   MODELAPI_EXPORT static void send(ObjectPtr theObject,
454                                    const void* theSender);
455
456   /// Creates an empty message
457   MODELAPI_EXPORT
458     ModelAPI_ReplaceParameterMessage(const Events_ID theID, const void* theSender = 0);
459   /// The virtual destructor
460   MODELAPI_EXPORT virtual ~ModelAPI_ReplaceParameterMessage();
461
462   /// Returns an object
463   MODELAPI_EXPORT ObjectPtr object() const;
464   /// Sets an object
465   MODELAPI_EXPORT void setObject(ObjectPtr theObject);
466 };
467
468 /// Message that sends the sketch solver and sketcher GUI processes to show in the property panel
469 class ModelAPI_SolverFailedMessage : public Events_Message
470 {
471 public:
472   /// Creates an message
473   MODELAPI_EXPORT ModelAPI_SolverFailedMessage(const Events_ID theID, const void* theSender = 0);
474   /// Default destructor
475   MODELAPI_EXPORT virtual ~ModelAPI_SolverFailedMessage();
476
477   /// Sets list of conflicting constraints
478   MODELAPI_EXPORT void setObjects(const std::set<ObjectPtr>& theObjects);
479   /// Returns list of conflicting constraints
480   MODELAPI_EXPORT const std::set<ObjectPtr>& objects() const;
481
482   /// Sets degrees of freedom
483   void dof(const int theDOF) { myDOF = theDOF; }
484   /// Returns degrees of freedom
485   const int& dof() const { return myDOF; }
486
487 private:
488   std::set<ObjectPtr> myObjects;
489   int myDOF;
490 };
491
492 /// Message sent when feature or attribute has been moved.
493 /// Stores the moving object/attribute, original and new positions of mouse.
494 class ModelAPI_ObjectMovedMessage : public Events_Message
495 {
496   ObjectPtr myMovedObject;
497   AttributePtr myMovedAttribute;
498   int myMovedPointIndex;
499
500   std::shared_ptr<GeomAPI_Pnt2d> myOriginalPosition;
501   std::shared_ptr<GeomAPI_Pnt2d> myCurrentPosition;
502
503 public:
504   MODELAPI_EXPORT ModelAPI_ObjectMovedMessage(const void* theSender = 0);
505
506   /// Set object which is being moved (if the message already contains attribute it will be cleared)
507   MODELAPI_EXPORT void setMovedObject(const ObjectPtr& theMovedObject);
508   /// Set attribute which is being moved (if the message already contains object it will be cleared)
509   /// \param[in] theMovedAttribute moved attribute
510   /// \param[in] thePointIndex     index of the point if the moved attribute is an array of points
511   MODELAPI_EXPORT void setMovedAttribute(const AttributePtr& theMovedAttribute,
512                                          const int thePointIndex = -1);
513
514   /// Return moved object
515   ObjectPtr movedObject() const
516   { return myMovedObject; }
517   /// Return moved attribute
518   AttributePtr movedAttribute() const
519   { return myMovedAttribute; }
520   /// Return index of the moved point
521   int movedPointIndex() const
522   { return myMovedPointIndex; }
523
524   /// Set original mouse position
525   MODELAPI_EXPORT void setOriginalPosition(double theX, double theY);
526   /// Set original mouse position
527   MODELAPI_EXPORT void setOriginalPosition(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
528   /// Return original mouse position
529   const std::shared_ptr<GeomAPI_Pnt2d>& originalPosition() const
530   { return myOriginalPosition; }
531
532   /// Set current mouse position
533   MODELAPI_EXPORT void setCurrentPosition(double theX, double theY);
534   /// Set current mouse position
535   MODELAPI_EXPORT void setCurrentPosition(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
536   /// Return current mouse position
537   const std::shared_ptr<GeomAPI_Pnt2d>& currentPosition() const
538   { return myCurrentPosition; }
539 };
540
541 #endif