1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef ModelAPI_EventReentrantMessage_H_
22 #define ModelAPI_EventReentrantMessage_H_
24 #include <Events_Message.h>
25 #include <Events_Loop.h>
31 class ModelAPI_Object;
32 class ModelAPI_Feature;
33 class ModelAPI_Attribute;
36 /// Message that style of visualization of parameter is changed.
37 /// It will be shown as expression or value
38 class ModelAPI_EventReentrantMessage : public Events_Message
41 /// Creates an empty message
42 MODELAPI_EXPORT ModelAPI_EventReentrantMessage(const Events_ID theID,
43 const void* theSender);
44 /// The virtual destructor
45 MODELAPI_EXPORT virtual ~ModelAPI_EventReentrantMessage() {}
46 /// Static. Returns EventID of the message.
47 MODELAPI_EXPORT static Events_ID eventId()
49 static const char * MY_EVENT_REENTRANT_MESSAGE_ID("EventReentrantMessage");
50 return Events_Loop::eventByName(MY_EVENT_REENTRANT_MESSAGE_ID);
53 /// Fills previous feature parameter
54 MODELAPI_EXPORT void setCreatedFeature(const std::shared_ptr<ModelAPI_Feature>& theFeature)
55 { myCreatedFeature = theFeature; }
57 /// Returns previous feature parameter
58 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Feature>& createdFeature() const
59 { return myCreatedFeature; }
61 /// Fills selected object parameter
62 /// \theObject a feature or result
63 MODELAPI_EXPORT void setSelectedObject(const std::shared_ptr<ModelAPI_Object>& theObject)
64 { mySelectedObject = theObject; }
66 /// Returns selected object parameter
67 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Object>& selectedObject() const
68 { return mySelectedObject; }
70 /// Fills selected attribute parameter
72 MODELAPI_EXPORT void setSelectedAttribute
73 (const std::shared_ptr<ModelAPI_Attribute>& theAttribute)
74 { mySelectedAttribute = theAttribute; }
76 /// Returns selected attribute parameter
77 MODELAPI_EXPORT const std::shared_ptr<ModelAPI_Attribute>& selectedAttribute()
78 { return mySelectedAttribute; }
80 /// Fills clicked point
82 MODELAPI_EXPORT void setClickedPoint(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint)
83 { myClickedPoint = thePoint; }
85 /// Returns clicked point
86 MODELAPI_EXPORT const std::shared_ptr<GeomAPI_Pnt2d>& clickedPoint()
87 { return myClickedPoint; }
90 std::shared_ptr<ModelAPI_Feature> myCreatedFeature; ///< previous object
91 std::shared_ptr<ModelAPI_Object> mySelectedObject; ///< selected object
92 std::shared_ptr<ModelAPI_Attribute> mySelectedAttribute; ///< selected attribute
93 std::shared_ptr<GeomAPI_Pnt2d> myClickedPoint; ///< clicked point
96 typedef std::shared_ptr<ModelAPI_EventReentrantMessage> ReentrantMessagePtr;