Iterates over subshapes in a shape. More...
#include <cadex/ModelData/ShapeIterator.hxx>
Public Member Functions | |
ShapeIterator (const Body &theBody) | |
ShapeIterator (const Shape &theShape) | |
ShapeIterator (const Body &theBody, ShapeType theType) | |
ShapeIterator (const Shape &theShape, ShapeType theType) | |
bool | HasNext () const |
const Shape & | Next () |
![]() | |
size_t | Id () const |
Return unique identifier of public object. | |
internal::BaseObjectImpl * | Impl () const |
bool | IsNull () const |
operator bool () const | |
template<typename T > | |
bool | IsOfType () const |
template<typename T > | |
T * | Impl () const |
Reserved for internal use. | |
Additional Inherited Members | |
![]() | |
typedef std::shared_ptr< internal::BaseObjectImpl > | ImplType |
![]() | |
BaseObject (const ImplType &theImpl) | |
Iterates over subshapes in a shape.
Iterator supports two usage scenario:
To retrive direct children of a shape, ModelData::ShapeIterator should be used as follows:
To retrive children of a particular type, ModelData::ShapeIterator should be used by specifying a type of interest as follows:
When using the latter approach exploration is done traversing the graph of subshapes in a depth-first manner. Each subshape will be found as many times as it is registered in the parent subshape. For instance, a seam-edge will be encountered twice, with forward and reversed orientations.
The order of returned subshapes is deterministic and corresponds to the order in which the subshapes were added during construction.