X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ViewerFilters.cpp;h=81f84dda6641d9c604cbac02c90ef19374fd4ecb;hb=af851100774c4ff33b515c884abe0cd03c3f0528;hp=a7e2cd3f7b383a80988a86f2f1d8ab396fb37274;hpb=35a88fdd724349275bbff32b9596a44e7cd422e2;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.cpp b/src/ModuleBase/ModuleBase_ViewerFilters.cpp index a7e2cd3f7..81f84dda6 100644 --- a/src/ModuleBase/ModuleBase_ViewerFilters.cpp +++ b/src/ModuleBase/ModuleBase_ViewerFilters.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_ViewerFilters.cpp // Created: 07 Okt 2014 // Author: Vitaly SMETANNIKOV @@ -37,7 +39,11 @@ Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_Ent if (aObj) { DocumentPtr aDoc = aObj->document(); SessionPtr aMgr = ModelAPI_Session::get(); - return (aDoc == aMgr->activeDocument() /* MPV: for the current moment selection in other document is not possible || (aDoc == aMgr->moduleDocument()*/); + return (aDoc == aMgr->activeDocument() || aDoc == aMgr->moduleDocument()); + } + else { + // This is not object controlled by the filter + return Standard_True; } } } @@ -74,6 +80,10 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(const Handle(SelectMgr_Enti bool aD3 = myPlane.Distance(aLastPnt) < Precision::Confusion(); return aD1 && aD2 && aD3; } + default: + // This is not object controlled by the filter + return Standard_True; + break; } } else { // This is not object controlled by the filter @@ -82,32 +92,3 @@ Standard_Boolean ModuleBase_ShapeInPlaneFilter::IsOk(const Handle(SelectMgr_Enti } return Standard_False; } - - -IMPLEMENT_STANDARD_HANDLE(ModuleBase_ObjectTypesFilter, SelectMgr_Filter); -IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ObjectTypesFilter, SelectMgr_Filter); - - -//TODO (VSV): Check bug in OCCT: Filter result is ignored (bug25340) -Standard_Boolean ModuleBase_ObjectTypesFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const -{ - Standard_Boolean isOk = ModuleBase_ShapeDocumentFilter::IsOk(theOwner); - if (isOk && theOwner->HasSelectable()) { - Handle(AIS_InteractiveObject) aAisObj = - Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); - if (!aAisObj.IsNull()) { - std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); - aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); - ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); - - foreach (QString aType, myTypes) { - if (aType.toLower() == "construction") { - ResultConstructionPtr aConstr = - std::dynamic_pointer_cast(aObj); - return (aConstr != NULL); - } // ToDo: Process other types of objects - } - } - } - return Standard_False; -}