static const char * EVENT_OPERATION_LAUNCHED = "OperationLaunched";
/// Event ID that plugin is loaded (comes with ModelAPI_ObjectUpdatedMessage)
static const char * EVENT_PLUGIN_LOADED = "PliginLoaded";
+/// Event ID that data of feature has to be shown (comes with ModelAPI_ObjectUpdatedMessage)
+static const char * EVENT_OBJECT_TOSHOW = "ObjectShow";
+/// Event ID that data of feature has to be shown (comes with ModelAPI_ObjectUpdatedMessage)
+static const char * EVENT_OBJECT_TOHIDE = "ObjectHide";
/// Message that feature was changed (used for Object Browser update): moved, updated and deleted
class ModelAPI_ObjectUpdatedMessage : public Events_MessageGroup
aLoop->registerListener(this, Events_Loop::eventByName("LongOperation"));
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_PLUGIN_LOADED));
aLoop->registerListener(this, Events_Loop::eventByName("CurrentDocumentChanged"));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TOSHOW));
+ aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TOHIDE));
registerValidators();
activateModule();
QApplication::restoreOverrideCursor();
}
+ else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TOSHOW)) {
+ boost::shared_ptr<ModelAPI_ObjectUpdatedMessage> anUpdateMsg =
+ boost::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+ const std::set<ObjectPtr>& aObjList = anUpdateMsg->objects();
+ QList<ObjectPtr> aList;
+ std::set<ObjectPtr>::const_iterator aIt;
+ for (aIt = aObjList.cbegin(); aIt != aObjList.cend(); ++aIt)
+ aList.append(*aIt);
+ showObjects(aList, true);
+ }
+
+ else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE)) {
+ boost::shared_ptr<ModelAPI_ObjectUpdatedMessage> anUpdateMsg =
+ boost::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+ const std::set<ObjectPtr>& aObjList = anUpdateMsg->objects();
+ QList<ObjectPtr> aList;
+ std::set<ObjectPtr>::const_iterator aIt;
+ for (aIt = aObjList.cbegin(); aIt != aObjList.cend(); ++aIt)
+ aList.append(*aIt);
+ showObjects(aList, false);
+ }
+
//An operation passed by message. Start it, process and commit.
else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OPERATION_LAUNCHED)) {
boost::shared_ptr<Config_PointerMessage> aPartSetMsg =