Salome HOME
Warnings correction for moc files generation
[modules/shaper.git] / src / XGUI / XGUI_WorkshopListener.cpp
index b67966ac34300c2d6897890d04b94ca9062c5fb0..11e1d9866b551d8d32ed0f39f02d9acfc4708f84 100755 (executable)
 #include <ModuleBase_OperationFeature.h>
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_IViewer.h>
-#include <ModuleBase_FilterFactory.h>
 #include <ModuleBase_WidgetSelector.h>
 
 #include <Config_FeatureMessage.h>
 #include <Config_PointerMessage.h>
-#include <Config_SelectionFilterMessage.h>
 #include <Config_Keywords.h>
 #include <Events_InfoMessage.h>
 
@@ -90,7 +88,6 @@ void XGUI_WorkshopListener::initializeEventListening()
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   aLoop->registerListener(this, Events_LongOp::eventID());
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_PLUGIN_LOADED));
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_SELFILTER_LOADED));
 
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED));
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED));
@@ -157,17 +154,6 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr<Events_Message>&
     } else {
       QApplication::restoreOverrideCursor();
     }
-  }
-  else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_SELFILTER_LOADED)) {
-    std::shared_ptr<Config_SelectionFilterMessage> aMsg =
-      std::dynamic_pointer_cast<Config_SelectionFilterMessage>(theMessage);
-    if (aMsg) {
-      ModuleBase_FilterFactory* aFactory = myWorkshop->selectionFilters();
-      if (!aMsg->attributeId().empty()) {
-        aFactory->assignFilter(aMsg->selectionFilterId(), aMsg->featureId(), aMsg->attributeId(),
-                               aMsg->parameters());
-      }
-    }
   } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED)) {
     // the viewer's update context will not happens until viewer updated is emitted
       workshop()->displayer()->enableUpdateViewer(false);
@@ -413,30 +399,6 @@ void XGUI_WorkshopListener::
         aDisplayed = displayObject(anObject);
         if (aDisplayed)
           aDoFitAll = aDoFitAll || neededFitAll(anObject, aNbOfShownObjects);
-
-        // workaround for #1750: sub results should be sent here to be displayed
-        FeaturePtr anObjectFeature = ModelAPI_Feature::feature(anObject);
-        if (anObjectFeature.get() && anObjectFeature->getKind() == "Partition") {
-          XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
-          if (anOperationMgr->hasOperation()) {
-            ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
-                                                            (anOperationMgr->currentOperation());
-            if (aFOperation && aFOperation->isEditOperation() &&
-                aFOperation->id() == "Remove_SubShapes") {
-              ResultCompSolidPtr aCompsolidResult =
-                                   std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anObject);
-              if (aCompsolidResult.get() != NULL) { // display all sub results
-                for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
-                  ObjectPtr aSubObject = aCompsolidResult->subResult(i);
-                  aSubObject->setDisplayed(true);
-                  aDisplayed = displayObject(aSubObject);
-                  if (aDisplayed)
-                    aDoFitAll = aDoFitAll || neededFitAll(aSubObject, aNbOfShownObjects);
-                }
-              }
-            }
-          }
-        }
       } else
         anObject->setDisplayed(false);
     }