+void XGUI_Selection::getSelectedInBrowser(QList<ModuleBase_ViewerPrs>& thePresentations) const
+{
+ // collect the objects of the parameter presentation to avoid a repeted objects in the result
+ QObjectPtrList aPresentationObjects;
+ QList<ModuleBase_ViewerPrs>::const_iterator aPrsIt = thePresentations.begin(),
+ aPrsLast = thePresentations.end();
+ for (; aPrsIt != aPrsLast; aPrsIt++) {
+ aPresentationObjects.push_back((*aPrsIt).object());
+ }
+
+ QObjectPtrList anObjects = selectedObjects();
+ QObjectPtrList::const_iterator anIt = anObjects.begin(), aLast = anObjects.end();
+ for (; anIt != aLast; anIt++) {
+ ObjectPtr anObject = *anIt;
+ if (anObject.get() != NULL && !aPresentationObjects.contains(anObject)) {
+ thePresentations.append(ModuleBase_ViewerPrs(anObject, TopoDS_Shape(), NULL));
+ }
+ }
+}
+
+void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrs& thePrs,
+ const Handle(SelectMgr_EntityOwner)& theOwner) const
+{
+ thePrs.setOwner(theOwner);
+
+ Handle(AIS_InteractiveObject) anIO =
+ Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable());
+ thePrs.setInteractive(anIO);
+
+ // we should not check the appearance of this feature because there can be some selected shapes
+ // for one feature
+ Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
+ if( !aBRO.IsNull() && aBRO->HasShape() ) {
+ // the located method is called in the context to obtain the shape by the SelectedShape() method,
+ // so the shape is located by the same rules
+ TopoDS_Shape aShape = aBRO->Shape().Located (aBRO->Location() * aBRO->Shape().Location());
+ if (!aShape.IsNull())
+ thePrs.setShape(aShape);
+ }
+
+ XGUI_Displayer* aDisplayer = myWorkshop->displayer();
+ ObjectPtr aFeature = aDisplayer->getObject(anIO);
+ thePrs.setObject(aFeature);
+}
+
+QList<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted() const