]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_Displayer.cpp
Salome HOME
It provides a point attribute restore selection by activation of a shape selection...
[modules/shaper.git] / src / XGUI / XGUI_Displayer.cpp
index 5254c1ea6d40e10be803a613fa7ae93ba2217c14..83fa8010dd1dce83aedec88d74947ef59887dbd6 100644 (file)
@@ -426,19 +426,16 @@ void XGUI_Displayer::setSelected(const  QList<ModuleBase_ViewerPrs>& theValues,
     aContext->ClearSelected();
     //if (aSelected.size() > 0) {
     foreach (ModuleBase_ViewerPrs aPrs, theValues) {
-    //    if (isValidSelection(aPrs)) {
-    //foreach(ObjectPtr aResult, theResults) {
-      ObjectPtr anObject = aPrs.object();
-      ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
-      if (aResult.get() && isVisible(aResult)) {
-        AISObjectPtr anObj = myResult2AISObjectMap[aResult];
-        Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
-        if (!anAIS.IsNull()) {
-          const TopoDS_Shape& aShape = aPrs.shape();
-          if (!aShape.IsNull()) {
-            aContext->AddOrRemoveSelected(aShape, false);
-          }
-          else {
+      const TopoDS_Shape& aShape = aPrs.shape();
+      if (!aShape.IsNull()) {
+        aContext->AddOrRemoveSelected(aShape, false);
+      } else {
+        ObjectPtr anObject = aPrs.object();
+        ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
+        if (aResult.get() && isVisible(aResult)) {
+          AISObjectPtr anObj = myResult2AISObjectMap[aResult];
+          Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
+          if (!anAIS.IsNull()) {
             // The methods are replaced in order to provide multi-selection, e.g. restore selection
             // by activating multi selector widget. It also gives an advantage that the multi
             // selection in OB gives multi-selection in the viewer
@@ -452,7 +449,6 @@ void XGUI_Displayer::setSelected(const  QList<ModuleBase_ViewerPrs>& theValues,
   } else {
     aContext->UnhilightCurrents();
     aContext->ClearCurrents();
-    //foreach(ObjectPtr aResult, theResults) {
     foreach (ModuleBase_ViewerPrs aPrs, theValues) {
       ObjectPtr anObject = aPrs.object();
       ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);