X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Filters.h;h=0e02759bf73d71c722added3ceb4f74494922de3;hb=refs%2Fheads%2FV9_11_BR;hp=c4e727035453e9bbd1e5ec510b7a5582d45cff6f;hpb=682438a4bfd569dd672e736f30e325345c49943e;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Filters.h b/src/PartSet/PartSet_Filters.h index c4e727035..0e02759bf 100644 --- a/src/PartSet/PartSet_Filters.h +++ b/src/PartSet/PartSet_Filters.h @@ -1,14 +1,29 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_Filters.h -// Created: 08 Nov 2014 -// Author: Vitaly SMETANNIKOV +// Copyright (C) 2014-2023 CEA, EDF +// +// 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 +// #ifndef PartSet_Filters_H #define PartSet_Filters_H #include +#include +#include /** * \class PartSet_GlobalFilter @@ -21,16 +36,41 @@ class PartSet_GlobalFilter: public ModuleBase_ShapeDocumentFilter public: /// Constructor /// \param theWorkshop a pointer to workshop - PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop) - : ModuleBase_ShapeDocumentFilter(theWorkshop) {} + PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop); /// Returns True if selected presentation can be selected /// \param theOwner an owner of the persentation - Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; + Standard_EXPORT virtual Standard_Boolean + IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; - DEFINE_STANDARD_RTTI(PartSet_GlobalFilter) + DEFINE_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter) }; +/// \class PartSet_ResultGroupNameFilter +/// \ingroup Modules +/// A class which filters results with groupName() result in filter parameters +DEFINE_STANDARD_HANDLE(PartSet_ResultGroupNameFilter, SelectMgr_Filter); +class PartSet_ResultGroupNameFilter: public SelectMgr_Filter +{ +public: + /// Constructor + /// \param theWorkshop a pointer to workshop + PartSet_ResultGroupNameFilter(ModuleBase_IWorkshop* theWorkshop) + : SelectMgr_Filter(), myWorkshop(theWorkshop) {} + + void setGroupNames(const std::set& theGroupNames); + + /// Returns True if selected presentation can be selected + /// \param theOwner an owner of the persentation + Standard_EXPORT virtual Standard_Boolean + IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; + + DEFINE_STANDARD_RTTIEXT(PartSet_ResultGroupNameFilter, SelectMgr_Filter) + +private: + ModuleBase_IWorkshop* myWorkshop; + std::set myGroupNames; +}; /// \class PartSet_CirclePointFilter /// \ingroup GUI @@ -49,9 +89,10 @@ public: /// Returns True if the given owner is acceptable for selection /// \param theOwner the selected owner - Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; + Standard_EXPORT virtual Standard_Boolean + IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; - DEFINE_STANDARD_RTTI(PartSet_CirclePointFilter) + DEFINE_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter) private: