Salome HOME
refs #193: OCC viwer problems when move line
[modules/shaper.git] / src / XGUI / XGUI_Displayer.cpp
index 736de32d2d7059deaafe0394e5b8e1d83f5cf0cd..0bdf7633e70b7beec87742510e57237057f02272 100644 (file)
@@ -232,14 +232,11 @@ void XGUI_Displayer::setSelected(const QList<ObjectPtr>& theResults, const bool
   aContext->ClearSelected();
   foreach(ObjectPtr aResult, theResults)
   {
-    if (myResult2AISObjectMap.find(aResult) == myResult2AISObjectMap.end())
-      continue;
-
-    AISObjectPtr anObj = myResult2AISObjectMap[aResult];
-    if (anObj) {
+    if (isVisible(aResult)) {
+      AISObjectPtr anObj = myResult2AISObjectMap[aResult];
       Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
       if (!anAIS.IsNull())
-        aContext->AddOrRemoveSelected(anAIS, false);
+        aContext->SetSelected(anAIS, false);
     }
   }
   if (isUpdateViewer)