X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFiltersPlugin%2FFiltersPlugin_ContinuousFaces.h;fp=src%2FFiltersPlugin%2FFiltersPlugin_ContinuousFaces.h;h=386b2de171987ddc82d9ad7e77d0f3a0c6324bd9;hb=edc11bc233d6a429f6191c993fe815e7d25b066a;hp=0000000000000000000000000000000000000000;hpb=f45b7121e69d6b7800c828f9e1673961b0752707;p=modules%2Fshaper.git diff --git a/src/FiltersPlugin/FiltersPlugin_ContinuousFaces.h b/src/FiltersPlugin/FiltersPlugin_ContinuousFaces.h new file mode 100644 index 000000000..386b2de17 --- /dev/null +++ b/src/FiltersPlugin/FiltersPlugin_ContinuousFaces.h @@ -0,0 +1,73 @@ +// Copyright (C) 2014-2021 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 FILTERSPLUGIN_CONTINUOUSFACES_H_ +#define FILTERSPLUGIN_CONTINUOUSFACES_H_ + +#include "FiltersPlugin.h" + +#include +#include + +#include + +typedef std::set SetOfShapes; + +/**\class FiltersPlugin_ContinuousFaces +* \ingroup DataModel +* \brief Filter for face with specific area +*/ +class FiltersPlugin_ContinuousFaces : public ModelAPI_Filter +{ +public: + FiltersPlugin_ContinuousFaces() : ModelAPI_Filter() { + myAngle = 0.0; + } + + virtual const std::string& name() const { + static const std::string kName("Continuous faces"); + return kName; + } + + /// Returns true for face type + virtual bool isSupported(GeomAPI_Shape::ShapeType theType) const override; + + /// This method should contain the filter logic. It returns true if the given shape + /// is accepted by the filter. + /// \param theShape the given shape + /// \param theArgs arguments of the filter + virtual bool isOk(const GeomShapePtr& theShape, const ResultPtr&, + const ModelAPI_FiltersArgs& theArgs) const override; + + /// Returns XML string which represents GUI of the filter + virtual std::string xmlRepresentation() const override; + + /// Initializes arguments of a filter. + virtual void initAttributes(ModelAPI_FiltersArgs& theArguments) override; + + private: + /// Original faces selected for filtering + SetOfShapes myFaces; + /// Shapes applicable for the filter + SetOfShapes myCachedShapes; + /// Angle tolerance + double myAngle; +}; + +#endif