X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Selection.cpp;h=5af4ea4c3f4739988c0d331433bb58b6507f1b20;hb=3e6012473696e5fd94e3c8240e2e1eda8def1743;hp=f1d2a09b7c58a738a7b8be2f6c77214469719787;hpb=3b85a6447fe7ec25c2079ffe3466d7266d1361fd;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index f1d2a09b7..5af4ea4c3 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -123,7 +123,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, const Handle(SelectMgr_EntityOwner)& theOwner) const { thePrs->setOwner(theOwner); - + Handle(SelectMgr_SelectableObject) aSelectable = theOwner->Selectable(); Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); thePrs->setInteractive(anIO); @@ -242,31 +242,15 @@ QList 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 aGeomShape = - std::shared_ptr(new GeomAPI_Shape()); - aGeomShape->setImpl(new TopoDS_Shape(aShape)); - aPrs->setShape(aGeomShape); - } - aPresentations.push_back(aPrs); - } } return aPresentations; } QObjectPtrList XGUI_Selection::selectedObjects() const { - return myWorkshop->objectBrowser()->selectedObjects(); + if (myWorkshop->objectBrowser()) + return myWorkshop->objectBrowser()->selectedObjects(); + return QObjectPtrList(); } void XGUI_Selection::setSelectedObjects( const QObjectPtrList& theObjects ) const