1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: ModelAPI_EventReentrantMessage.h
4 // Created: 30 Mar 2017
5 // Author: Natalia ERMOLAEVA
7 #ifndef ModelAPI_EventReentrantMessage_H_
8 #define ModelAPI_EventReentrantMessage_H_
10 #include <Events_Message.h>
11 #include <Events_Loop.h>
17 class ModelAPI_Object;
18 class ModelAPI_Feature;
19 class ModelAPI_Attribute;
22 /// Message that style of visualization of parameter is changed.
23 /// It will be shown as expression or value
24 class ModelAPI_EventReentrantMessage : public Events_Message
27 /// Creates an empty message
28 MODELAPI_EXPORT ModelAPI_EventReentrantMessage(const Events_ID theID,
29 const void* theSender = 0);
30 /// The virtual destructor
31 MODELAPI_EXPORT virtual ~ModelAPI_EventReentrantMessage() {}
32 /// Static. Returns EventID of the message.
33 MODELAPI_EXPORT static Events_ID eventId()
35 static const char * MY_EVENT_REENTRANT_MESSAGE_ID("EventReentrantMessage");
36 return Events_Loop::eventByName(MY_EVENT_REENTRANT_MESSAGE_ID);
39 /// Fills previous feature parameter
40 MODELAPI_EXPORT void setCreatedFeature(const std::shared_ptr<ModelAPI_Feature>& theFeature)
41 { myCreatedFeature = theFeature; }
43 /// Returns previous feature parameter
44 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Feature>& createdFeature() const
45 { return myCreatedFeature; }
47 /// Fills selected object parameter
48 /// \theObject a feature or result
49 MODELAPI_EXPORT void setSelectedObject(const std::shared_ptr<ModelAPI_Object>& theObject)
50 { mySelectedObject = theObject; }
52 /// Returns selected object parameter
53 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Object>& selectedObject() const
54 { return mySelectedObject; }
56 /// Fills selected attribute parameter
58 MODELAPI_EXPORT void setSelectedAttribute
59 (const std::shared_ptr<ModelAPI_Attribute>& theAttribute)
60 { mySelectedAttribute = theAttribute; }
62 /// Returns selected attribute parameter
63 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Attribute>& selectedAttribute()
64 { return mySelectedAttribute; }
66 /// Fills clicked point
68 MODELAPI_EXPORT void setClickedPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
69 { myClickedPoint = thePoint; }
71 /// Returns clicked point
72 MODELAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt2d>& clickedPoint()
73 { return myClickedPoint; }
76 std::shared_ptr<ModelAPI_Feature> myCreatedFeature; ///< previous object
77 std::shared_ptr<ModelAPI_Object> mySelectedObject; ///< selected object
78 std::shared_ptr<ModelAPI_Attribute> mySelectedAttribute; ///< selected attribute
79 std::shared_ptr<GeomAPI_Pnt2d> myClickedPoint; ///< clicked point
82 typedef std::shared_ptr<ModelAPI_EventReentrantMessage> ReentrantMessagePtr;