Salome HOME
Fix for the issue #593: do not remove naming attribute, but use TNaming_Builder for...
[modules/shaper.git] / src / XGUI / XGUI_Selection.cpp
index 0de6255da0409c105be963a079a74d2ab4e0551c..3f93b29ac9002770b910a309d33f48634a344c63 100644 (file)
@@ -93,7 +93,7 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrs& thePrs,
      
   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
   ObjectPtr aFeature = aDisplayer->getObject(anIO);
-  thePrs.setFeature(aFeature);
+  thePrs.setObject(aFeature);
 }
 
 QList<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted() const
@@ -115,7 +115,7 @@ QList<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted() const
     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.setFeature(aResult);
+    aPrs.setObject(aResult);
     if (aContext->HasOpenedContext()) {
       TopoDS_Shape aShape = aContext->DetectedShape();
       if (!aShape.IsNull())
@@ -162,6 +162,20 @@ void XGUI_Selection::selectedAISObjects(AIS_ListOfInteractive& theList) const
     theList.Append(aContext->SelectedInteractive());
 }
 
+//**************************************************************
+ObjectPtr XGUI_Selection::getSelectableObject(const Handle(SelectMgr_EntityOwner)& theOwner) const
+{
+  ObjectPtr anObject;
+
+  Handle(SelectMgr_EntityOwner) aEO = theOwner;
+  if (!aEO.IsNull()) {
+    Handle(AIS_InteractiveObject) anObj = 
+      Handle(AIS_InteractiveObject)::DownCast(aEO->Selectable());
+    anObject = myWorkshop->displayer()->getObject(anObj);
+  }
+  return anObject;
+}
+
 //**************************************************************
 void XGUI_Selection::selectedShapes(NCollection_List<TopoDS_Shape>& theList, 
                                     std::list<ObjectPtr>& theOwners) const