return;
GetFilter()->Clear();
}
+
+void XGUI_Displayer::showOnly(const QObjectPtrList& theList)
+{
+ QObjectPtrList aDispList = myResult2AISObjectMap.keys();
+ foreach(ObjectPtr aObj, aDispList) {
+ if (!theList.contains(aObj))
+ erase(aObj, false);
+ }
+ foreach(ObjectPtr aObj, theList) {
+ if (!isVisible(aObj))
+ display(aObj, false);
+ }
+ updateViewer();
+}
DisplayMode displayMode(ObjectPtr theObject) const;
+ /// Displays only objects listed in the list
+ void showOnly(const QObjectPtrList& theList);
+
+ /// Returns number of displayed objects
int objectsCount() const { return myResult2AISObjectMap.size(); }
protected:
{
foreach (ObjectPtr aObj, theList)
{
- ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
- if (aRes) {
- if (isVisible) {
- myDisplayer->display(aRes, false);
- } else {
- myDisplayer->erase(aRes, false);
- }
+ if (isVisible) {
+ myDisplayer->display(aObj, false);
+ } else {
+ myDisplayer->erase(aObj, false);
}
}
myDisplayer->updateViewer();
//**************************************************************
void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList)
{
- myDisplayer->eraseAll(false);
- showObjects(theList, true);
+ myDisplayer->showOnly(theList);
}