PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
if (aPreviewOp) {
aPreviewOp->setEditMode(true);
- // the preview should be shown in another local context
visualizePreview(false);
- visualizePreview(true);
}
}
if (isDisplay) {
boost::shared_ptr<GeomAPI_Shape> aPreview = aPreviewOp->preview();
if (aPreview) {
- aDisplayer->LocalSelection(anOperation->feature(),
- aPreview->impl<TopoDS_Shape>(), aPreviewOp->getSelectionMode());
+ aDisplayer->DisplayInLocalContext(anOperation->feature(), aPreview->impl<TopoDS_Shape>(),
+ aPreviewOp->getSelectionMode());
}
}
else {
- aDisplayer->GlobalSelection(false);
+ aDisplayer->CloseLocalContexts(false);
aDisplayer->Erase(anOperation->feature());
}
}
aContext->UpdateCurrentViewer();
}
-void XGUI_Displayer::LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature,
- const TopoDS_Shape& theShape,
- const int theMode, const bool isUpdateViewer)
+void XGUI_Displayer::DisplayInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+ const TopoDS_Shape& theShape,
+ const int theMode, const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) aContext = AISContext();
AIS_ListOfInteractive anAISList;
anAISList.Append(anAIS);
- setLocalSelection(anAISList, theMode, true);
+ activateInLocalContext(anAISList, theMode, true);
}
-void XGUI_Displayer::GlobalSelection(const bool isUpdateViewer)
+void XGUI_Displayer::CloseLocalContexts(const bool isUpdateViewer)
{
- setGlobalSelection(true);
+ closeAllContexts(true);
}
-void XGUI_Displayer::setLocalSelection(const AIS_ListOfInteractive& theAISObjects, const int theMode,
- const bool isUpdateViewer)
+void XGUI_Displayer::activateInLocalContext(const AIS_ListOfInteractive& theAISObjects, const int theMode,
+ const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) ic = AISContext();
ic->UpdateCurrentViewer();
}
-void XGUI_Displayer::setGlobalSelection(const bool isUpdateViewer)
+void XGUI_Displayer::closeAllContexts(const bool isUpdateViewer)
{
Handle(AIS_InteractiveContext) ic = AISContext();
if (!ic.IsNull()) {
/// \param theShape a shape
/// \param theMode a local selection mode
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
- const int theMode, const bool isUpdateViewer = true);
+ void DisplayInLocalContext(boost::shared_ptr<ModelAPI_Feature> theFeature,
+ const TopoDS_Shape& theShape,
+ const int theMode, const bool isUpdateViewer = true);
/// Erase the feature and a shape.
/// \param theFeature a feature instance
/// Deactivates selection of sub-shapes
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- void GlobalSelection(const bool isUpdateViewer = true);
+ void CloseLocalContexts(const bool isUpdateViewer = true);
+protected:
/// Activate local selection
/// \param theAIS the list of objects
/// \param theMode the selection mode
/// \param isUpdateViewer the state wether the viewer should be updated immediatelly
- void setLocalSelection(const AIS_ListOfInteractive& theAISObjects, const int theMode,
- const bool isUpdateViewer);
+ void activateInLocalContext(const AIS_ListOfInteractive& theAISObjects, const int theMode,
+ const bool isUpdateViewer);
/// Deactivate local selection
/// \param isUpdateViewer the state wether the viewer should be updated immediatelly
- void setGlobalSelection(const bool isUpdateViewer);
+ void closeAllContexts(const bool isUpdateViewer);
/// Returns currently installed AIS_InteractiveContext
Handle(AIS_InteractiveContext) AISContext() const { return myAISContext; }