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