X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ViewerFilters.cpp;h=1e56112a7ebf23a03a1c47737af88e9a23831ca2;hb=a2982d2108f929cf9e7f996cfd590c4ce59dc21c;hp=c18fd0eaee48ff5041442082755b10f51ea28e5f;hpb=34a24fe3e0c4feb8ac57697c49aefedc524b6db0;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.cpp b/src/ModuleBase/ModuleBase_ViewerFilters.cpp index c18fd0eae..1e56112a7 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 @@ -31,13 +33,17 @@ Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_Ent Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { - boost::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); + std::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 (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 @@ -96,14 +106,14 @@ Standard_Boolean ModuleBase_ObjectTypesFilter::IsOk(const Handle(SelectMgr_Entit Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { - boost::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); + 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 = - boost::dynamic_pointer_cast(aObj); + std::dynamic_pointer_cast(aObj); return (aConstr != NULL); } // ToDo: Process other types of objects }