1 // File: PartSet_Listener.h
2 // Created: 28 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include <PartSet_Listener.h>
7 #include <PartSet_Module.h>
9 #include <XGUI_Displayer.h>
11 #include <Events_Loop.h>
12 #include <Model_Events.h>
20 PartSet_Listener::PartSet_Listener(PartSet_Module* theModule)
23 Events_Loop* aLoop = Events_Loop::loop();
24 Events_ID aFeatureUpdatedId = aLoop->eventByName(EVENT_FEATURE_UPDATED);
25 aLoop->registerListener(this, aFeatureUpdatedId);
28 PartSet_Listener::~PartSet_Listener()
32 //******************************************************
33 void PartSet_Listener::processEvent(const Events_Message* theMessage)
35 if (QString(theMessage->eventID().eventText()) == EVENT_FEATURE_UPDATED)
37 const Model_FeatureUpdatedMessage* aUpdMsg = dynamic_cast<const Model_FeatureUpdatedMessage*>(theMessage);
38 boost::shared_ptr<ModelAPI_Feature> aFeature = aUpdMsg->feature();
39 if (myModule->workshop()->displayer()->IsVisible(aFeature))
40 myModule->visualizePreview(aFeature, true);