X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Filters.cpp;h=2851ea877dc2fac100e4d03b987cd42eceebc1a7;hb=eef71d826050b8d7fa4f0aa152798a22523a58bb;hp=f2c82f246a353219b02736eff3d7f65bf096633d;hpb=682438a4bfd569dd672e736f30e325345c49943e;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Filters.cpp b/src/PartSet/PartSet_Filters.cpp index f2c82f246..2851ea877 100644 --- a/src/PartSet/PartSet_Filters.cpp +++ b/src/PartSet/PartSet_Filters.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_Filters.cpp -// Created: 08 Nov 2014 -// Author: Vitaly SMETANNIKOV +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "PartSet_Filters.h" @@ -19,7 +33,6 @@ #include -IMPLEMENT_STANDARD_HANDLE(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter); IMPLEMENT_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter); Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const @@ -33,7 +46,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& if (ModuleBase_ShapeDocumentFilter::IsOk(theOwner)) { std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); if (theOwner->HasSelectable()) { - Handle(AIS_InteractiveObject) aAisObj = + Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); @@ -42,8 +55,8 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); if (aObj) { ResultPtr aResult = std::dynamic_pointer_cast(aObj); - // result of parts belongs to PartSet document and can be selected only when PartSet is active - // in order to do not select the result of the active part. + // result of parts belongs to PartSet document and can be selected only when PartSet + // is active in order to do not select the result of the active part. if (aResult.get() && aResult->groupName() == ModelAPI_ResultPart::group()) { SessionPtr aMgr = ModelAPI_Session::get(); aValid = aMgr->activeDocument() == aMgr->moduleDocument(); @@ -52,7 +65,7 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); if (aFeature) { aValid = aFeature->getKind() != "Group"; - } else + } else aValid = Standard_True; } } else @@ -66,10 +79,10 @@ Standard_Boolean PartSet_GlobalFilter::IsOk(const Handle(SelectMgr_EntityOwner)& return aValid; } -IMPLEMENT_STANDARD_HANDLE(PartSet_CirclePointFilter, SelectMgr_Filter); IMPLEMENT_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter); -Standard_Boolean PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const +Standard_Boolean + PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const { ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); if(!anOperation) { @@ -90,7 +103,8 @@ Standard_Boolean PartSet_CirclePointFilter::IsOk(const Handle(SelectMgr_EntityOw return Standard_True; } - Handle(ModuleBase_ResultPrs) aResultPrs = Handle(ModuleBase_ResultPrs)::DownCast(theOwner->Selectable()); + Handle(ModuleBase_ResultPrs) aResultPrs = + Handle(ModuleBase_ResultPrs)::DownCast(theOwner->Selectable()); if(aResultPrs.IsNull()) { return Standard_True; }