SHAPER 9.16.0
ModelAPI_FiltersFactory.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
3// This library is free software; you can redistribute it and/or
4// modify it under the terms of the GNU Lesser General Public
5// License as published by the Free Software Foundation; either
6// version 2.1 of the License, or (at your option) any later version.
7//
8// This library is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11// Lesser General Public License for more details.
12//
13// You should have received a copy of the GNU Lesser General Public
14// License along with this library; if not, write to the Free Software
15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef ModelAPI_FiltersFactory_H_
21#define ModelAPI_FiltersFactory_H_
22
23#include "ModelAPI_Feature.h"
24#include "ModelAPI_Filter.h"
25#include "ModelAPI_ResultBody.h"
26
27#include <GeomAPI_Shape.h>
28
29
35{
36public:
37 virtual ~ModelAPI_FiltersFactory() {}
38
42 virtual void registerFilter(const std::string& theID, ModelAPI_Filter* theFilter) = 0;
43
49 virtual bool isValid(FeaturePtr theFiltersFeature,
50 ResultPtr theResult,
51 GeomShapePtr theShape) = 0;
52
57 virtual std::list< std::pair<ResultPtr, GeomShapePtr> > select
58 (const FiltersFeaturePtr& theFilterFeature,
59 const GeomAPI_Shape::ShapeType theShapeType) = 0;
60
62 virtual std::list<FilterPtr> filters(GeomAPI_Shape::ShapeType theType) = 0;
63
65 virtual FilterPtr filter(std::string theID) = 0;
66
68 virtual std::string id(FilterPtr theFilter) = 0;
69
70protected:
73};
74
75#endif
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Definition: ModelAPI_Filter.h:34
Manages registering of filters.
Definition: ModelAPI_FiltersFactory.h:35
virtual std::list< std::pair< ResultPtr, GeomShapePtr > > select(const FiltersFeaturePtr &theFilterFeature, const GeomAPI_Shape::ShapeType theShapeType)=0
Returns list of all shapes and subshapes in the study, satisfying criteria of all filters of theFilte...
virtual bool isValid(FeaturePtr theFiltersFeature, ResultPtr theResult, GeomShapePtr theShape)=0
Returns true if all filters of the Filters feature are ok for the Shape (taking into account the Reve...
virtual void registerFilter(const std::string &theID, ModelAPI_Filter *theFilter)=0
Register an instance of a filter.
virtual std::list< FilterPtr > filters(GeomAPI_Shape::ShapeType theType)=0
Returns the filters that support the given shape type.
virtual std::string id(FilterPtr theFilter)=0
Returns a filter ID by the filter pointer.
virtual FilterPtr filter(std::string theID)=0
Returns a filter by ID.
ModelAPI_FiltersFactory()
Get instance from Session.
Definition: ModelAPI_FiltersFactory.h:72