return aFeature;
}
+std::list<XGUI_ViewerPrs> XGUI_Displayer::GetViewerPrs
+ (const NCollection_List<TopoDS_Shape>& theShapes)
+{
+ std::list<XGUI_ViewerPrs> aPresentations;
+ if (theShapes.IsEmpty())
+ return aPresentations;
+
+ NCollection_List<TopoDS_Shape>::Iterator anIt(theShapes);
+ for (; anIt.More(); anIt.Next()) {
+ const TopoDS_Shape& aShape = anIt.Value();
+ if (aShape.IsNull())
+ continue;
+ boost::shared_ptr<ModelAPI_Feature> aFeature = GetFeature(aShape);
+ aPresentations.push_back(XGUI_ViewerPrs(aFeature, aShape));
+ }
+
+ return aPresentations;
+}
+
void XGUI_Displayer::Erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
const bool isUpdateViewer)
{
aContext->UpdateCurrentViewer();
}
+void XGUI_Displayer::EraseAll(const bool isUpdateViewer)
+{
+ Handle(AIS_InteractiveContext) ic = AISContext();
+
+ AIS_ListOfInteractive aList;
+ ic->DisplayedObjects(aList);
+ AIS_ListIteratorOfListOfInteractive anIter(aList);
+ for (; anIter.More(); anIter.Next()) {
+ if ((anIter.Value()->DynamicType() == STANDARD_TYPE(AIS_Trihedron)))
+ continue;
+
+ // erase an object
+ Handle(AIS_InteractiveObject) anIO = anIter.Value();
+ ic->Erase(anIO, false);
+ }
+ myFeature2AISObjectMap.clear();
+ if (isUpdateViewer)
+ ic->UpdateCurrentViewer();
+}
+
void XGUI_Displayer::CloseLocalContexts(const bool isUpdateViewer)
{
closeAllContexts(true);
}
}
+void XGUI_Displayer::UpdateViewer()
+{
+ Handle(AIS_InteractiveContext) ic = AISContext();
+ if (!ic.IsNull())
+ ic->UpdateCurrentViewer();
+}
+
Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
{
return myWorkshop->viewer()->AISContext();