Salome HOME
Better management of errors.
[modules/shaper.git] / src / XGUI / XGUI_Selection.cpp
index 36849ab9eb47bbb99184d0d0edfc513b1bf78fae..5af4ea4c3f4739988c0d331433bb58b6507f1b20 100644 (file)
@@ -233,13 +233,6 @@ QList<ModuleBase_ViewerPrsPtr> XGUI_Selection::getHighlighted() const
   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
   for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
     Handle(SelectMgr_EntityOwner) anOwner = aContext->DetectedOwner();
-    try {
-      // It is checking of existence of presentation object
-      // BUG of OCCT
-      Handle(AIS_InteractiveObject) aTest = aContext->DetectedInteractive();
-    } catch (...) {
-      continue;
-    }
     if (!anOwner.IsNull()) {
       if (aSelectedIds.contains((long)anOwner.get()))
         continue;
@@ -249,24 +242,6 @@ QList<ModuleBase_ViewerPrsPtr> XGUI_Selection::getHighlighted() const
       fillPresentation(aPrs, anOwner);
       aPresentations.push_back(aPrs);
     }
-    else { // TODO: check why the entity owner is null here, case is selection point on a line
-      Handle(AIS_InteractiveObject) anIO = aContext->DetectedInteractive();
-      ModuleBase_ViewerPrsPtr aPrs(new ModuleBase_ViewerPrs());
-      aPrs->setInteractive(anIO);
-
-      ObjectPtr aResult = aDisplayer->getObject(anIO);
-      // we should not check the appearance of this feature because there can be some selected
-      // shapes for one feature
-      aPrs->setObject(aResult);
-      TopoDS_Shape aShape = aContext->DetectedShape();
-      if (!aShape.IsNull()) {
-        std::shared_ptr<GeomAPI_Shape> aGeomShape =
-          std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
-        aGeomShape->setImpl(new TopoDS_Shape(aShape));
-        aPrs->setShape(aGeomShape);
-      }
-      aPresentations.push_back(aPrs);
-    }
   }
   return aPresentations;
 }