aAction = new QAction(QIcon(":pictures/eye_pencil.png"), tr("Show"), this);
addAction("SHOW_CMD", aAction);
+ aAction = new QAction(QIcon(":pictures/eye_pencil.png"), tr("Show only"), this);
+ addAction("SHOW_ONLY_CMD", aAction);
+
aAction = new QAction(QIcon(":pictures/eye_pencil_closed.png"), tr("Hide"), this);
addAction("HIDE_CMD", aAction);
}
} else {
if (aDisplayer->isVisible(aObject))
aMenu->addAction(action("HIDE_CMD"));
- else
+ else {
aMenu->addAction(action("SHOW_CMD"));
+ }
+ aMenu->addAction(action("SHOW_ONLY_CMD"));
}
} else { // If feature is 0 the it means that selected root object (document)
if (aMgr->currentDocument() != aMgr->rootDocument())
if (hasResult) {
aMenu->addAction(action("SHOW_CMD"));
aMenu->addAction(action("HIDE_CMD"));
+ aMenu->addAction(action("SHOW_ONLY_CMD"));
}
if (hasFeature)
aMenu->addAction(action("DELETE_CMD"));
updateViewer();
}
-/*void XGUI_Displayer::EraseAll(const bool isUpdateViewer)
+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);
+ Handle(AIS_InteractiveContext) ic = AISContext();
+
+ ResultToAISMap::iterator aIt;
+ for (aIt = myResult2AISObjectMap.begin(); aIt != myResult2AISObjectMap.end(); aIt++) {
+ // erase an object
+ boost::shared_ptr<GeomAPI_AISObject> aAISObj = (*aIt).second;
+ Handle(AIS_InteractiveObject) anIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
+ if (!anIO.IsNull())
+ ic->Remove(anIO, false);
+ }
+ myResult2AISObjectMap.clear();
+ if (isUpdateViewer)
+ updateViewer();
}
- myResult2AISObjectMap.clear();
- if (isUpdateViewer)
- updateViewer();
- }*/
void XGUI_Displayer::eraseDeletedResults(const bool isUpdateViewer)
{
/// Erase all presentations
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
- //void EraseAll(const bool isUpdateViewer = true);
+ void eraseAll(const bool isUpdateViewer = true);
/// Erase AIS interactive objects, which has an empty feature in the internal map
/// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
showObjects(aObjects, true);
else if (theId == "HIDE_CMD")
showObjects(aObjects, false);
+ else if (theId == "SHOW_ONLY_CMD")
+ showOnlyObjects(aObjects);
}
//**************************************************************
myDisplayer->updateViewer();
}
+//**************************************************************
+void XGUI_Workshop::showOnlyObjects(const QList<ObjectPtr>& theList)
+{
+ myDisplayer->eraseAll(false);
+ showObjects(theList, true);
+}
+
+
//**************************************************************
void XGUI_Workshop::updateCommandsOnViewSelection()
{
//! Show the given features in 3d Viewer
void showObjects(const QList<ObjectPtr>& theList, bool isVisible);
+ //! Show the given features in 3d Viewer
+ void showOnlyObjects(const QList<ObjectPtr>& theList);
+
ModuleBase_IModule* module() const
{
return myModule;