X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_WorkshopListener.cpp;h=849466192813c7078634f398aa82845264f3d8b0;hb=176403004ff97696f3c0b5f8bdf48692177fb34a;hp=984388b5c6ac4b3d9850fa71431ec906c0da51c4;hpb=5b4e69308550c299e14f336d489dc0aefbc5d6f4;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index 984388b5c..849466192 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -85,7 +85,6 @@ void XGUI_WorkshopListener::initializeEventListening() //Initialize event listening Events_Loop* aLoop = Events_Loop::loop(); aLoop->registerListener(this, Events_InfoMessage::errorID()); //!< Listening application errors. - aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); @@ -139,7 +138,8 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION)) { ModuleBase_ModelWidget* aWidget = workshop()->propertyPanel()->activeWidget(); if (aWidget) { - ModuleBase_WidgetSelector* aWidgetSelector = dynamic_cast(aWidget); + ModuleBase_WidgetSelector* aWidgetSelector = + dynamic_cast(aWidget); if (aWidgetSelector) myWorkshop->setSelected(aWidgetSelector->getAttributeSelection()); } @@ -158,26 +158,6 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& QApplication::restoreOverrideCursor(); } } - //An operation passed by message. Start it, process and commit. - else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OPERATION_LAUNCHED)) { - std::shared_ptr aPartSetMsg = - std::dynamic_pointer_cast(theMessage); - //myPropertyPanel->cleanContent(); - ModuleBase_Operation* anOperation = (ModuleBase_Operation*) aPartSetMsg->pointer(); - XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); - - if (anOperationMgr->startOperation(anOperation)) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(anOperation); - if (aFOperation) { - workshop()->propertyPanel()->updateContentWidget(aFOperation->feature()); - workshop()->propertyPanel()->createContentPanel(aFOperation->feature()); - } - if (!anOperation->getDescription()->hasXmlRepresentation()) { - if (anOperation->commit()) - workshop()->updateCommandStatus(); - } - } - } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_SELFILTER_LOADED)) { std::shared_ptr aMsg = std::dynamic_pointer_cast(theMessage); @@ -197,7 +177,8 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& aDisplayer->enableUpdateViewer(true); } else { //Show error dialog if error message received. - std::shared_ptr anIngfoMsg = std::dynamic_pointer_cast(theMessage); + std::shared_ptr anIngfoMsg = + std::dynamic_pointer_cast(theMessage); if (anIngfoMsg) { emit errorOccurred(anIngfoMsg); } @@ -223,7 +204,8 @@ void XGUI_WorkshopListener::onFeatureUpdatedMsg( anInfo.append(ModuleBase_Tools::objectInfo((*aIt))); } QString anInfoStr = anInfo.join(";\t"); - qDebug(QString("onFeatureUpdatedMsg: %1, %2").arg(anObjects.size()).arg(anInfoStr).toStdString().c_str()); + qDebug(QString("onFeatureUpdatedMsg: %1, %2") + .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str()); #endif std::set aFeatures = theMsg->objects(); XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); @@ -249,7 +231,8 @@ void XGUI_WorkshopListener::onFeatureUpdatedMsg( } //****************************************************** -void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr& theMsg) +void XGUI_WorkshopListener:: + onFeatureRedisplayMsg(const std::shared_ptr& theMsg) { std::set anObjects = theMsg->objects(); std::set::const_iterator aIt; @@ -260,13 +243,15 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptrdisplayer(); - bool aFirstVisualizedBody = false; - + //bool aFirstVisualizedBody = false; + bool aDoFitAll = false; + int aNbOfShownObjects = workshop()->displayer()->objectsCount(); bool aRedisplayed = false; //std::list aHiddenObjects; for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) { @@ -290,7 +275,8 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr(aRes); if (aCompSolidRes.get()) { - qDebug(QString("COMPSOLID, numberOfSubs = %1").arg(aCompSolidRes->numberOfSubs()).toStdString().c_str()); + qDebug(QString("COMPSOLID, numberOfSubs = %1") + .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str()); } if (ModelAPI_Tools::compSolidOwner(aRes)) qDebug("COMPSOLID sub-object"); @@ -308,16 +294,16 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr