From: vsv Date: Fri, 17 Oct 2014 08:37:35 +0000 (+0400) Subject: ViewerFilters transferred from XGUI to ModuleBase X-Git-Tag: V_0.5~93 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7778069b85fb13f2cd02c3cf5ad8ba6233b24e11;p=modules%2Fshaper.git ViewerFilters transferred from XGUI to ModuleBase --- diff --git a/src/ModuleBase/CMakeLists.txt b/src/ModuleBase/CMakeLists.txt index 4a778cb41..7641722e4 100644 --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@ -32,6 +32,7 @@ SET(PROJECT_HEADERS ModuleBase_IViewer.h ModuleBase_WidgetLineEdit.h ModuleBase_WidgetMultiSelector.h + ModuleBase_ViewerFilters.h ) SET(PROJECT_SOURCES @@ -57,6 +58,7 @@ SET(PROJECT_SOURCES ModuleBase_DoubleSpinBox.cpp ModuleBase_WidgetLineEdit.cpp ModuleBase_WidgetMultiSelector.cpp + ModuleBase_ViewerFilters.cpp ) SET(PROJECT_LIBRARIES diff --git a/src/ModuleBase/ModuleBase_IWorkshop.h b/src/ModuleBase/ModuleBase_IWorkshop.h index 700f2baec..d6d3c416b 100644 --- a/src/ModuleBase/ModuleBase_IWorkshop.h +++ b/src/ModuleBase/ModuleBase_IWorkshop.h @@ -9,6 +9,7 @@ #include "ModuleBase_Definitions.h" #include +#include #include @@ -49,6 +50,12 @@ Q_OBJECT //! Returns currently active operation virtual ModuleBase_Operation* currentOperation() const = 0; + //! Returns AIS opbject by data object + virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0; + + //! Returns data object by AIS + virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0; + signals: void selectionChanged(); diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.cpp b/src/ModuleBase/ModuleBase_ViewerFilters.cpp new file mode 100644 index 000000000..6626a1668 --- /dev/null +++ b/src/ModuleBase/ModuleBase_ViewerFilters.cpp @@ -0,0 +1,36 @@ +// File: ModuleBase_ViewerFilters.cpp +// Created: 07 Okt 2014 +// Author: Vitaly SMETANNIKOV + + +#include "ModuleBase_ViewerFilters.h" +#include "ModuleBase_IWorkshop.h" + +#include +#include + +#include + +IMPLEMENT_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter); +IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter); + + +//TODO (VSV): Check bug in OCCT: Filter result is ignored (bug25340) +Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const +{ + if (theOwner->HasSelectable()) { + Handle(AIS_InteractiveObject) aAisObj = + Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); + if (!aAisObj.IsNull()) { + boost::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); + aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); + ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); + if (aObj) { + DocumentPtr aDoc = aObj->document(); + SessionPtr aMgr = ModelAPI_Session::get(); + return (aDoc == aMgr->activeDocument()) || (aDoc == aMgr->moduleDocument()); + } + } + } + return Standard_False; +} \ No newline at end of file diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.h b/src/ModuleBase/ModuleBase_ViewerFilters.h new file mode 100644 index 000000000..55ad0b686 --- /dev/null +++ b/src/ModuleBase/ModuleBase_ViewerFilters.h @@ -0,0 +1,31 @@ +// File: ModuleBase_ViewerFilters.h +// Created: 07 Okt 2014 +// Author: Vitaly SMETANNIKOV + + +#ifndef ModuleBase_ViewerFilters_H +#define ModuleBase_ViewerFilters_H + +#include +#include + + +class ModuleBase_IWorkshop; + +DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter); + +class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter +{ +public: + Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(), + myWorkshop(theWorkshop) {} + + Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; + + DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter) + +private: + ModuleBase_IWorkshop* myWorkshop; +}; + +#endif \ No newline at end of file diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 84bf567a3..d1b54dcc1 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -94,8 +94,6 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop) SLOT(onKeyRelease(QKeyEvent*))); connect(myWorkshop->viewer(), SIGNAL(mouseDoubleClick(QMouseEvent*)), this, SLOT(onMouseDoubleClick(QMouseEvent*))); - - myDocumentShapeFilter = new XGUI_ShapeDocumentFilter(aXWshop->displayer()); } PartSet_Module::~PartSet_Module() @@ -165,9 +163,6 @@ void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation) aDisplayer->setSelectionModes(aModes); } } - } else { - //TODO (VSV): We have to open Local context because at neutral point filters don't work (bug 25340) - aDisplayer->addSelectionFilter(myDocumentShapeFilter); } } @@ -209,8 +204,8 @@ void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation) // aDisplayer->activate(*aIt); //} - // The document limitation selection has to be only during operation - aDisplayer->removeSelectionFilter(myDocumentShapeFilter); + + } // Clear selection done during operation aDisplayer->clearSelected(); diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index a91f67943..88f745776 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -146,8 +145,6 @@ Q_OBJECT std::map myFeaturesInFiles; - /// A filter which provides selection within a current document or whole PartSet - Handle(XGUI_ShapeDocumentFilter) myDocumentShapeFilter; Handle(StdSelect_FaceFilter) myPlaneFilter; }; diff --git a/src/XGUI/CMakeLists.txt b/src/XGUI/CMakeLists.txt index ace172c50..0a07539a4 100644 --- a/src/XGUI/CMakeLists.txt +++ b/src/XGUI/CMakeLists.txt @@ -33,7 +33,6 @@ SET(PROJECT_HEADERS XGUI_Preferences.h XGUI_IPrefMgr.h XGUI_QtEvents.h - XGUI_ViewerFilters.h ) SET(PROJECT_AUTOMOC @@ -67,7 +66,6 @@ SET(PROJECT_SOURCES XGUI_Selection.cpp XGUI_Preferences.cpp XGUI_QtEvents.cpp - XGUI_ViewerFilters.cpp ) SET(PROJECT_RESOURCES diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 264699899..dbe635b33 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -47,18 +47,18 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer) if (isVisible(theObject)) { redisplay(theObject, isUpdateViewer); } else { - boost::shared_ptr anAIS; + AISObjectPtr anAIS; GeomPresentablePtr aPrs = boost::dynamic_pointer_cast(theObject); bool isShading = false; if (aPrs) { - anAIS = aPrs->getAISObject(boost::shared_ptr()); + anAIS = aPrs->getAISObject(AISObjectPtr()); } else { ResultPtr aResult = boost::dynamic_pointer_cast(theObject); if (aResult) { boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (aShapePtr) { - anAIS = boost::shared_ptr(new GeomAPI_AISObject()); + anAIS = AISObjectPtr(new GeomAPI_AISObject()); anAIS->createShape(aShapePtr); isShading = true; } @@ -69,7 +69,7 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer) } } -void XGUI_Displayer::display(ObjectPtr theObject, boost::shared_ptr theAIS, +void XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading, bool isUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); @@ -92,7 +92,7 @@ void XGUI_Displayer::erase(ObjectPtr theObject, const bool isUpdateViewer) Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull()) return; - boost::shared_ptr anObject = myResult2AISObjectMap[theObject]; + AISObjectPtr anObject = myResult2AISObjectMap[theObject]; if (anObject) { Handle(AIS_InteractiveObject) anAIS = anObject->impl(); if (!anAIS.IsNull()) { @@ -108,10 +108,10 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer) return; Handle(AIS_InteractiveObject) aAISIO; - boost::shared_ptr aAISObj = getAISObject(theObject); + AISObjectPtr aAISObj = getAISObject(theObject); GeomPresentablePtr aPrs = boost::dynamic_pointer_cast(theObject); if (aPrs) { - boost::shared_ptr aAIS_Obj = aPrs->getAISObject(aAISObj); + AISObjectPtr aAIS_Obj = aPrs->getAISObject(aAISObj); if (aAISObj && !aAIS_Obj) { erase(theObject, isUpdateViewer); return; @@ -149,7 +149,7 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject) if (aContext.IsNull()) return; - boost::shared_ptr anObj = myResult2AISObjectMap[theObject]; + AISObjectPtr anObj = myResult2AISObjectMap[theObject]; Handle(AIS_InteractiveObject) anAIS = anObj->impl(); aContext->Deactivate(anAIS); } @@ -162,7 +162,7 @@ void XGUI_Displayer::activate(ObjectPtr theObject, const QIntList& theModes) if (aContext.IsNull()) return; - boost::shared_ptr anObj = myResult2AISObjectMap[theObject]; + AISObjectPtr anObj = myResult2AISObjectMap[theObject]; Handle(AIS_InteractiveObject) anAIS = anObj->impl(); if (aContext->HasOpenedContext()) { aContext->Load(anAIS, -1, true); @@ -184,7 +184,7 @@ bool XGUI_Displayer::isActive(ObjectPtr theObject) const if (!isVisible(theObject)) return false; - boost::shared_ptr anObj = myResult2AISObjectMap.at(theObject); + AISObjectPtr anObj = myResult2AISObjectMap.at(theObject); Handle(AIS_InteractiveObject) anAIS = anObj->impl(); TColStd_ListOfInteger aModes; @@ -243,7 +243,7 @@ void XGUI_Displayer::setSelected(const QList& theResults, const bool if (myResult2AISObjectMap.find(aResult) == myResult2AISObjectMap.end()) continue; - boost::shared_ptr anObj = myResult2AISObjectMap[aResult]; + AISObjectPtr anObj = myResult2AISObjectMap[aResult]; if (anObj) { Handle(AIS_InteractiveObject) anAIS = anObj->impl(); if (!anAIS.IsNull()) @@ -271,7 +271,7 @@ void XGUI_Displayer::eraseAll(const bool isUpdateViewer) ResultToAISMap::iterator aIt; for (aIt = myResult2AISObjectMap.begin(); aIt != myResult2AISObjectMap.end(); aIt++) { // erase an object - boost::shared_ptr aAISObj = (*aIt).second; + AISObjectPtr aAISObj = (*aIt).second; Handle(AIS_InteractiveObject) anIO = aAISObj->impl(); if (!anIO.IsNull()) ic->Remove(anIO, false); @@ -293,7 +293,7 @@ void XGUI_Displayer::eraseDeletedResults(const bool isUpdateViewer) for (; aFIt != aFLast; aFIt++) { ObjectPtr aFeature = (*aFIt).first; if (!aFeature || !aFeature->data() || !aFeature->data()->isValid()) { - boost::shared_ptr anObj = (*aFIt).second; + AISObjectPtr anObj = (*aFIt).second; if (!anObj) continue; Handle(AIS_InteractiveObject) anAIS = anObj->impl(); @@ -332,21 +332,27 @@ void XGUI_Displayer::closeLocalContexts(const bool isUpdateViewer) closeAllContexts(true); } -boost::shared_ptr XGUI_Displayer::getAISObject(ObjectPtr theObject) const +AISObjectPtr XGUI_Displayer::getAISObject(ObjectPtr theObject) const { - boost::shared_ptr anIO; + AISObjectPtr anIO; if (myResult2AISObjectMap.find(theObject) != myResult2AISObjectMap.end()) anIO = (myResult2AISObjectMap.find(theObject))->second; return anIO; } -ObjectPtr XGUI_Displayer::getObject(Handle(AIS_InteractiveObject) theIO) const +ObjectPtr XGUI_Displayer::getObject(const AISObjectPtr& theIO) const +{ + Handle(AIS_InteractiveObject) aRefAIS = theIO->impl(); + return getObject(aRefAIS); +} + +ObjectPtr XGUI_Displayer::getObject(const Handle(AIS_InteractiveObject)& theIO) const { ObjectPtr aFeature; ResultToAISMap::const_iterator aFIt = myResult2AISObjectMap.begin(), aFLast = myResult2AISObjectMap.end(); for (; aFIt != aFLast && !aFeature; aFIt++) { - boost::shared_ptr anObj = (*aFIt).second; + AISObjectPtr anObj = (*aFIt).second; if (!anObj) continue; Handle(AIS_InteractiveObject) anAIS = anObj->impl(); @@ -379,7 +385,7 @@ Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const return myWorkshop->viewer()->AISContext(); } -void XGUI_Displayer::display(boost::shared_ptr theAIS, bool isUpdate) +void XGUI_Displayer::display(AISObjectPtr theAIS, bool isUpdate) { Handle(AIS_InteractiveContext) aContext = AISContext(); Handle(AIS_InteractiveObject) anAISIO = theAIS->impl(); @@ -387,7 +393,7 @@ void XGUI_Displayer::display(boost::shared_ptr theAIS, bool i aContext->Display(anAISIO, isUpdate); } -void XGUI_Displayer::erase(boost::shared_ptr theAIS, const bool isUpdate) +void XGUI_Displayer::erase(AISObjectPtr theAIS, const bool isUpdate) { Handle(AIS_InteractiveContext) aContext = AISContext(); Handle(AIS_InteractiveObject) anAISIO = theAIS->impl(); @@ -440,7 +446,7 @@ void XGUI_Displayer::setDisplayMode(ObjectPtr theObject, DisplayMode theMode, bo if (aContext.IsNull()) return; - boost::shared_ptr aAISObj = getAISObject(theObject); + AISObjectPtr aAISObj = getAISObject(theObject); if (!aAISObj) return; @@ -476,7 +482,7 @@ XGUI_Displayer::DisplayMode XGUI_Displayer::displayMode(ObjectPtr theObject) con if (aContext.IsNull()) return NoMode; - boost::shared_ptr aAISObj = getAISObject(theObject); + AISObjectPtr aAISObj = getAISObject(theObject); if (!aAISObj) return NoMode; diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index e5a7405d0..7f117fea5 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -56,7 +56,7 @@ class XGUI_EXPORT XGUI_Displayer void display(ObjectPtr theObject, bool isUpdateViewer = true); /// Display the given AIS object. To hide this object use corresponde erase method - void display(boost::shared_ptr theAIS, bool isUpdate = true); + void display(AISObjectPtr theAIS, bool isUpdate = true); /// Stop the current selection and color the given features to the selection color /// \param theFeatures a list of features to be disabled @@ -82,7 +82,7 @@ class XGUI_EXPORT XGUI_Displayer void erase(ObjectPtr theObject, const bool isUpdateViewer = true); /// Erase the given AIS object displayed by corresponded display method - void erase(boost::shared_ptr theAIS, const bool isUpdate = true); + void erase(AISObjectPtr theAIS, const bool isUpdate = true); /// Erase all presentations /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly @@ -116,12 +116,13 @@ class XGUI_EXPORT XGUI_Displayer /// Searches the interactive object by feature /// \param theFeature the feature or NULL if it not visualized /// \return theIO an interactive object - boost::shared_ptr getAISObject(ObjectPtr theFeature) const; + AISObjectPtr getAISObject(ObjectPtr theFeature) const; /// Searches the feature by interactive object /// \param theIO an interactive object /// \return feature the feature or NULL if it not visualized - ObjectPtr getObject(Handle(AIS_InteractiveObject) theIO) const; + ObjectPtr getObject(const AISObjectPtr& theIO) const; + ObjectPtr getObject(const Handle(AIS_InteractiveObject)& theIO) const; /// Deactivates the given object (not allow selection) void deactivate(ObjectPtr theFeature); @@ -163,7 +164,7 @@ class XGUI_EXPORT XGUI_Displayer /// \param theAIS AIS presentation /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly /// Returns true if the Feature succesfully displayed - void display(ObjectPtr theObject, boost::shared_ptr theAIS, bool isShading, + void display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading, bool isUpdateViewer = true); /// Display the shape and activate selection of sub-shapes @@ -172,7 +173,7 @@ class XGUI_EXPORT XGUI_Displayer /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly /// \returns true if the presentation is created //bool redisplay(ObjectPtr theObject, - // boost::shared_ptr theAIS, + // AISObjectPtr theAIS, // const bool isUpdateViewer = true); /** Redisplay the shape if it was displayed @@ -184,7 +185,7 @@ class XGUI_EXPORT XGUI_Displayer protected: XGUI_Workshop* myWorkshop; - typedef std::map > ResultToAISMap; + typedef std::map ResultToAISMap; ResultToAISMap myResult2AISObjectMap; }; diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index ce9ca3680..5bb4445fe 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -10,6 +10,9 @@ #include "XGUI_OperationMgr.h" #include "XGUI_Displayer.h" +#include + + XGUI_ModuleConnector::XGUI_ModuleConnector(XGUI_Workshop* theWorkshop) : ModuleBase_IWorkshop(theWorkshop), myWorkshop(theWorkshop) @@ -23,10 +26,13 @@ XGUI_ModuleConnector::XGUI_ModuleConnector(XGUI_Workshop* theWorkshop) this, SIGNAL(operationStarted(ModuleBase_Operation*))); connect(anOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)), this, SIGNAL(operationStopped(ModuleBase_Operation*))); + + myDocumentShapeFilter = new ModuleBase_ShapeDocumentFilter(this); } XGUI_ModuleConnector::~XGUI_ModuleConnector() { + myDocumentShapeFilter.Nullify(); } ModuleBase_ISelection* XGUI_ModuleConnector::selection() const @@ -54,13 +60,32 @@ void XGUI_ModuleConnector::activateSubShapesSelection(const QIntList& theTypes) { XGUI_Displayer* aDisp = myWorkshop->displayer(); aDisp->openLocalContext(); - // Use empty list because we will use standard modes - aDisp->activateObjectsOutOfContext(QIntList()); - aDisp->setSelectionModes(theTypes); + // Convert shape types to selection types + QIntList aModes; + foreach(int aType, theTypes) { + aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum)aType)); + } + aDisp->activateObjectsOutOfContext(aModes); + //TODO: We have to open Local context because at neutral point filters don't work (bug 25340) + aDisp->addSelectionFilter(myDocumentShapeFilter); } void XGUI_ModuleConnector::deactivateSubShapesSelection() { XGUI_Displayer* aDisp = myWorkshop->displayer(); + // The document limitation selection has to be only during operation + aDisp->removeSelectionFilter(myDocumentShapeFilter); aDisp->closeLocalContexts(false); } + +AISObjectPtr XGUI_ModuleConnector::findPresentation(const ObjectPtr& theObject) const +{ + XGUI_Displayer* aDisp = myWorkshop->displayer(); + return aDisp->getAISObject(theObject); +} + +ObjectPtr XGUI_ModuleConnector::findPresentedObject(const AISObjectPtr& theAIS) const +{ + XGUI_Displayer* aDisp = myWorkshop->displayer(); + return aDisp->getObject(theAIS); +} \ No newline at end of file diff --git a/src/XGUI/XGUI_ModuleConnector.h b/src/XGUI/XGUI_ModuleConnector.h index 054ad0872..f6d071f2a 100644 --- a/src/XGUI/XGUI_ModuleConnector.h +++ b/src/XGUI/XGUI_ModuleConnector.h @@ -8,6 +8,7 @@ #include "XGUI.h" #include #include +#include class Handle_AIS_InteractiveContext; class XGUI_Workshop; @@ -43,10 +44,19 @@ Q_OBJECT //! Returns currently active operation virtual ModuleBase_Operation* currentOperation() const; + //! Returns AIS opbject by data object + virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const; + + //! Returns data object by AIS + virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const; + XGUI_Workshop* workshop() const { return myWorkshop; } - private: +private: XGUI_Workshop* myWorkshop; + + /// A filter which provides selection within a current document or whole PartSet + Handle(ModuleBase_ShapeDocumentFilter) myDocumentShapeFilter; }; #endif diff --git a/src/XGUI/XGUI_ViewerFilters.cpp b/src/XGUI/XGUI_ViewerFilters.cpp deleted file mode 100644 index 6efd9143e..000000000 --- a/src/XGUI/XGUI_ViewerFilters.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// File: XGUI_ViewerFilters.cpp -// Created: 07 Okt 2014 -// Author: Vitaly SMETANNIKOV - - -#include "XGUI_ViewerFilters.h" -#include "XGUI_Displayer.h" - -#include -#include - -#include - -IMPLEMENT_STANDARD_HANDLE(XGUI_ShapeDocumentFilter, SelectMgr_Filter); -IMPLEMENT_STANDARD_RTTIEXT(XGUI_ShapeDocumentFilter, SelectMgr_Filter); - - -//TODO (VSV): Check bug in OCCT: Filter result is ignored (bug25340) -Standard_Boolean XGUI_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const -{ - if (theOwner->HasSelectable()) { - Handle(AIS_InteractiveObject) aAisObj = - Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); - if (!aAisObj.IsNull()) { - ObjectPtr aObj = myDisplayer->getObject(aAisObj); - if (aObj) { - DocumentPtr aDoc = aObj->document(); - SessionPtr aMgr = ModelAPI_Session::get(); - return (aDoc == aMgr->activeDocument()) || (aDoc == aMgr->moduleDocument()); - } - } - } - return Standard_False; -} \ No newline at end of file diff --git a/src/XGUI/XGUI_ViewerFilters.h b/src/XGUI/XGUI_ViewerFilters.h deleted file mode 100644 index f30f400ae..000000000 --- a/src/XGUI/XGUI_ViewerFilters.h +++ /dev/null @@ -1,31 +0,0 @@ -// File: XGUI_ViewerFilters.h -// Created: 07 Okt 2014 -// Author: Vitaly SMETANNIKOV - - -#ifndef XGUI_ViewerFilters_H -#define XGUI_ViewerFilters_H - -#include -#include - - -class XGUI_Displayer; - -DEFINE_STANDARD_HANDLE(XGUI_ShapeDocumentFilter, SelectMgr_Filter); - -class XGUI_ShapeDocumentFilter: public SelectMgr_Filter -{ -public: - Standard_EXPORT XGUI_ShapeDocumentFilter(XGUI_Displayer* myDisp): SelectMgr_Filter(), - myDisplayer(myDisp) {} - - Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; - - DEFINE_STANDARD_RTTI(XGUI_ShapeDocumentFilter) - -private: - XGUI_Displayer* myDisplayer; -}; - -#endif \ No newline at end of file