X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_Filter.h;h=07e1ee3a08b9add969493c0d6e730bd7671fc9e5;hb=a211165b993cec59888b300199b44b525c0daf69;hp=c18a6a56725b989e1a7ddd9e95e4e3f01f11217d;hpb=3874b57fe5aba25ff5aee2a07654fc23c1ee8eb0;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_Filter.h b/src/ModuleBase/ModuleBase_Filter.h index c18a6a567..07e1ee3a0 100644 --- a/src/ModuleBase/ModuleBase_Filter.h +++ b/src/ModuleBase/ModuleBase_Filter.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: ModuleBase_Filter.h -// Created: 10 Dec 2014 -// Author: Natalia ERMOLAEVA +// Copyright (C) 2014-2019 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 +// #ifndef ModuleBase_Filter_H #define ModuleBase_Filter_H @@ -11,7 +24,10 @@ #include +#include + /** + * \ingroup GUI * This object is assigned by the name * in the XML file to the specific attribute or to the whole feature. * If isOK method of the filter returns "false", it is signalized in user interface @@ -19,15 +35,33 @@ * Filterss must be registered in the filters factory to be * correctly identified by the XML string-ID. */ -DEFINE_STANDARD_HANDLE(ModuleBase_Filter, SelectMgr_Filter); -class ModuleBase_Filter: public SelectMgr_Filter +class ModuleBase_Filter { public: - Standard_EXPORT ModuleBase_Filter(): SelectMgr_Filter() {} + /// Constructor + MODULEBASE_EXPORT ModuleBase_Filter() {} + + /** + * Returns an OCC selection filter. It can be appended into the context of a viewer + * It creates a filter if it has not be created yet. + * \return the selection filter + */ + MODULEBASE_EXPORT Handle(SelectMgr_Filter) getFilter(); - Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const; + /** + * Sets the arguments to the filter. + * \param theArguments a list of arguments + */ + MODULEBASE_EXPORT virtual void setArguments(const std::list& theArguments) = 0; +protected: + /** + * It creates an internal instance of the OCC filter + */ + virtual void createFilter() = 0; - DEFINE_STANDARD_RTTI(ModuleBase_Filter) +protected: + /// current instance of the OCC selection filter + Handle(SelectMgr_Filter) myFilter; }; #endif //ModuleBase_Filter