SHAPER  9.12.0
Model_FiltersFactory Class Reference

Manages registering of filters. More...

Inheritance diagram for Model_FiltersFactory:
Inheritance graph

Public Member Functions

virtual void registerFilter (const std::string &theID, ModelAPI_Filter *theFilter)
 Register an instance of a filter. More...
 
virtual bool isValid (FeaturePtr theFiltersFeature, ResultPtr theResult, GeomShapePtr theShape)
 Returns true if all filters of the Filters feature are ok for the Shape (taking into account the Reversed states). More...
 
virtual std::list< std::pair< ResultPtr, GeomShapePtr > > select (const FiltersFeaturePtr &theFilterFeature, const GeomAPI_Shape::ShapeType theShapeType)
 Returns list of all shapes and subshapes in the study, satisfying criteria of all filters of theFilterFeature. More...
 
virtual std::list< FilterPtr > filters (GeomAPI_Shape::ShapeType theType)
 Returns the filters that support the given shape type. More...
 
virtual FilterPtr filter (std::string theID)
 Returns a filter by ID. More...
 
virtual std::string id (FilterPtr theFilter)
 Returns a filter ID by the filter pointer. More...
 

Protected Member Functions

 Model_FiltersFactory ()
 Get instance from Session. More...
 

Friends

class Model_Session
 

Detailed Description

Manages registering of filters.

Constructor & Destructor Documentation

◆ Model_FiltersFactory()

Model_FiltersFactory::Model_FiltersFactory ( )
inlineprotected

Get instance from Session.

Member Function Documentation

◆ registerFilter()

void Model_FiltersFactory::registerFilter ( const std::string &  theID,
ModelAPI_Filter theFilter 
)
virtual

Register an instance of a filter.

Parameters
theIDunique identifier of the filter, not necessary equal to the name of filter
theFilterthe filter's instance

Implements ModelAPI_FiltersFactory.

◆ isValid()

bool Model_FiltersFactory::isValid ( FeaturePtr  theFiltersFeature,
ResultPtr  theResult,
GeomShapePtr  theShape 
)
virtual

Returns true if all filters of the Filters feature are ok for the Shape (taking into account the Reversed states).

Parameters
theResultparent result of the shape to check
theShapethe checked shape

all filters and the reverse values

Implements ModelAPI_FiltersFactory.

◆ select()

std::list< std::pair< ResultPtr, GeomShapePtr > > Model_FiltersFactory::select ( const FiltersFeaturePtr &  theFilterFeature,
const GeomAPI_Shape::ShapeType  theShapeType 
)
virtual

Returns list of all shapes and subshapes in the study, satisfying criteria of all filters of theFilterFeature.

Parameters
theFiltersFeaturefeature that contains all information about the filters
theShapeTypethe type of sub-shapes to find

Implements ModelAPI_FiltersFactory.

◆ filters()

std::list< FilterPtr > Model_FiltersFactory::filters ( GeomAPI_Shape::ShapeType  theType)
virtual

Returns the filters that support the given shape type.

Returns list of filters for the given shape type.

Parameters
theTypea shape type

Implements ModelAPI_FiltersFactory.

◆ filter()

FilterPtr Model_FiltersFactory::filter ( std::string  theID)
virtual

Returns a filter by ID.

Implements ModelAPI_FiltersFactory.

◆ id()

std::string Model_FiltersFactory::id ( FilterPtr  theFilter)
virtual

Returns a filter ID by the filter pointer.

Implements ModelAPI_FiltersFactory.