SHAPER  9.12.0
GeomAPI_ShapeExplorer Class Reference

This class is used to explore subshapes on shape. More...

Inheritance diagram for GeomAPI_ShapeExplorer:
Inheritance graph

Public Member Functions

GEOMAPI_EXPORT GeomAPI_ShapeExplorer ()
 Default constructor. Creates an empty explorer, becomes usefull after Init. More...
 
GEOMAPI_EXPORT GeomAPI_ShapeExplorer (const std::shared_ptr< GeomAPI_Shape > &theShape, const GeomAPI_Shape::ShapeType toFind, const GeomAPI_Shape::ShapeType toAvoid=GeomAPI_Shape::SHAPE)
 Constructs an explorer to search on theShape, for shapes of type toFind, that are not part of a shape toAvoid. More...
 
GEOMAPI_EXPORT void init (const std::shared_ptr< GeomAPI_Shape > &theShape, const GeomAPI_Shape::ShapeType toFind, const GeomAPI_Shape::ShapeType toAvoid=GeomAPI_Shape::SHAPE)
 Resets this explorer. More...
 
GEOMAPI_EXPORT bool more () const
 
GEOMAPI_EXPORT void next ()
 Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore. More...
 
GEOMAPI_EXPORT std::shared_ptr< GeomAPI_Shapecurrent ()
 
GEOMAPI_EXPORT void reinit ()
 Reinitialize the exploration with the original arguments. More...
 
GEOMAPI_EXPORT int depth () const
 
GEOMAPI_EXPORT void clear ()
 Clears the content of the explorer. It will return False on more(). More...
 
template<class T >
T * implPtr ()
 Returns the pointer to the impl. More...
 
template<class T >
const T * implPtr () const
 Returns the pointer to the impl. More...
 
template<class T >
const T & impl () const
 Returns the reference object of the impl. More...
 
template<class T >
void setImpl (T *theImpl)
 Updates the impl (deletes the old one) More...
 
GEOMAPI_EXPORT bool empty () const
 Returns true if the impl is empty. More...
 

Detailed Description

This class is used to explore subshapes on shape.

Constructor & Destructor Documentation

◆ GeomAPI_ShapeExplorer() [1/2]

GeomAPI_ShapeExplorer::GeomAPI_ShapeExplorer ( )

Default constructor. Creates an empty explorer, becomes usefull after Init.

◆ GeomAPI_ShapeExplorer() [2/2]

GeomAPI_ShapeExplorer::GeomAPI_ShapeExplorer ( const std::shared_ptr< GeomAPI_Shape > &  theShape,
const GeomAPI_Shape::ShapeType  toFind,
const GeomAPI_Shape::ShapeType  toAvoid = GeomAPI_Shape::SHAPE 
)

Constructs an explorer to search on theShape, for shapes of type toFind, that are not part of a shape toAvoid.

If the shape toAvoid is equal to GeomAPI_SHape::SHAPE, or if it is the same as, or less complex than the shape toFind it has no effect on the search.

Parameters
[in]theShapeshape to explore.
[in]toFindshape type to find.
[in]toAvoidshape type to avoid.

Member Function Documentation

◆ init()

void GeomAPI_ShapeExplorer::init ( const std::shared_ptr< GeomAPI_Shape > &  theShape,
const GeomAPI_Shape::ShapeType  toFind,
const GeomAPI_Shape::ShapeType  toAvoid = GeomAPI_Shape::SHAPE 
)

Resets this explorer.

It is initialized to search on theShape, for shapes of type toFind, that are not part of a shape toAvoid. If the shape toAvoid is equal to GeomAPI_SHape::SHAPE, or if it is the same as, or less complex than the shape toFind it has no effect on the search.

Parameters
[in]theShapeshape to explore.
[in]toFindshape type to find.
[in]toAvoidshape type to avoid.

◆ more()

bool GeomAPI_ShapeExplorer::more ( ) const
Returns
true if there are more shapes in the exploration.

◆ next()

void GeomAPI_ShapeExplorer::next ( )

Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore.

◆ current()

std::shared_ptr< GeomAPI_Shape > GeomAPI_ShapeExplorer::current ( )
Returns
the current shape in the exploration or empty pointer if this explorer has no more shapes to explore.

◆ reinit()

void GeomAPI_ShapeExplorer::reinit ( )

Reinitialize the exploration with the original arguments.

◆ depth()

int GeomAPI_ShapeExplorer::depth ( ) const
Returns
the current depth of the exploration. 0 is the shape to explore itself.

◆ clear()

void GeomAPI_ShapeExplorer::clear ( )

Clears the content of the explorer. It will return False on more().

◆ implPtr() [1/2]

template<class T >
T* GeomAPI_Interface::implPtr ( )
inlineinherited

Returns the pointer to the impl.

◆ implPtr() [2/2]

template<class T >
const T* GeomAPI_Interface::implPtr ( ) const
inlineinherited

Returns the pointer to the impl.

◆ impl()

template<class T >
const T& GeomAPI_Interface::impl ( ) const
inlineinherited

Returns the reference object of the impl.

◆ setImpl()

template<class T >
void GeomAPI_Interface::setImpl ( T *  theImpl)
inlineinherited

Updates the impl (deletes the old one)

◆ empty()

bool GeomAPI_Interface::empty ( ) const
inherited

Returns true if the impl is empty.