Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
TopExp_Explorer Class Reference

An Explorer is a Tool to visit a Topological Data Structure from the TopoDS package. More...

#include <TopExp_Explorer.hxx>

Inheritance diagram for TopExp_Explorer:
Inheritance graph
[legend]

Public Member Functions

 TopExp_Explorer () noexcept
 Creates an empty explorer, becomes useful after Init.
 
 TopExp_Explorer (const TopoDS_Shape &S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid=TopAbs_SHAPE)
 Creates an Explorer on the Shape .
 
void Init (const TopoDS_Shape &S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid=TopAbs_SHAPE)
 Resets this explorer on the shape S. It is initialized to search the shape S, for shapes of type ToFind, that are not part of a shape ToAvoid. If the shape ToAvoid is equal to TopAbs_SHAPE, or if it is the same as, or less complex than, the shape ToFind it has no effect on the search.
 
bool More () const noexcept
 Returns True if there are more shapes in the exploration.
 
void Next ()
 Moves to the next Shape in the exploration.
 
const TopoDS_ShapeValue () const noexcept
 Returns the current shape in the exploration.
 
const TopoDS_ShapeCurrent () const noexcept
 Returns the current shape in the exploration.
 
void ReInit ()
 Reinitialize the exploration with the original arguments.
 
const TopoDS_ShapeExploredShape () const noexcept
 Return explored shape.
 
int Depth () const noexcept
 Returns the current depth of the exploration. 0 is the shape to explore itself.
 
void Clear ()
 Clears the content of the explorer.
 
 ~TopExp_Explorer ()
 Destructor.
 
NCollection_ForwardRangeIterator< TopExp_Explorerbegin ()
 Returns an STL-compatible iterator for range-based for loops.
 
NCollection_ForwardRangeSentinel end () const
 Returns a sentinel marking the end of iteration.
 

Detailed Description

An Explorer is a Tool to visit a Topological Data Structure from the TopoDS package.

An Explorer is built with:

The Explorer visits all the structure to find shapes of the requested type which are not contained in the type to avoid.

Example to find all the Faces in the Shape S :

TopExp_Explorer Ex; for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) { ProcessFace(Ex.Current()); }

// an other way TopExp_Explorer Ex(S,TopAbs_FACE); while (Ex.More()) { ProcessFace(Ex.Current()); Ex.Next(); }

To find all the vertices which are not in an edge :

for (Ex.Init(S,TopAbs_VERTEX,TopAbs_EDGE); ...)

To find all the faces in a SHELL, then all the faces not in a SHELL :

TopExp_Explorer Ex1, Ex2;

for (Ex1.Init(S,TopAbs_SHELL),...) { // visit all shells for (Ex2.Init(Ex1.Current(),TopAbs_FACE),...) { // visit all the faces of the current shell } }

for (Ex1.Init(S,TopAbs_FACE,TopAbs_SHELL),...) { // visit all faces not in a shell }

If the type to avoid is the same or is less complex than the type to find it has no effect.

For example searching edges not in a vertex does not make a difference.

Constructor & Destructor Documentation

◆ TopExp_Explorer() [1/2]

TopExp_Explorer::TopExp_Explorer ( )
noexcept

Creates an empty explorer, becomes useful after Init.

◆ TopExp_Explorer() [2/2]

TopExp_Explorer::TopExp_Explorer ( const TopoDS_Shape & S,
const TopAbs_ShapeEnum ToFind,
const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE )

Creates an Explorer on the Shape .

<ToFind> is the type of shapes to search. TopAbs_VERTEX, TopAbs_EDGE, ...

<ToAvoid> is the type of shape to skip in the exploration. If <ToAvoid> is equal or less complex than <ToFind> or if <ToAVoid> is SHAPE it has no effect on the exploration.

◆ ~TopExp_Explorer()

TopExp_Explorer::~TopExp_Explorer ( )

Destructor.

Member Function Documentation

◆ begin()

NCollection_ForwardRangeIterator< TopExp_Explorer > TopExp_Explorer::begin ( )
inline

Returns an STL-compatible iterator for range-based for loops.

Warning
Do not call Next() or Init() externally during range-for iteration.

◆ Clear()

void TopExp_Explorer::Clear ( )

Clears the content of the explorer.

◆ Current()

const TopoDS_Shape & TopExp_Explorer::Current ( ) const
noexcept

Returns the current shape in the exploration.

◆ Depth()

int TopExp_Explorer::Depth ( ) const
noexcept

Returns the current depth of the exploration. 0 is the shape to explore itself.

◆ end()

NCollection_ForwardRangeSentinel TopExp_Explorer::end ( ) const
inline

Returns a sentinel marking the end of iteration.

◆ ExploredShape()

const TopoDS_Shape & TopExp_Explorer::ExploredShape ( ) const
inlinenoexcept

Return explored shape.

◆ Init()

void TopExp_Explorer::Init ( const TopoDS_Shape & S,
const TopAbs_ShapeEnum ToFind,
const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE )

Resets this explorer on the shape S. It is initialized to search the shape S, for shapes of type ToFind, that are not part of a shape ToAvoid. If the shape ToAvoid is equal to TopAbs_SHAPE, or if it is the same as, or less complex than, the shape ToFind it has no effect on the search.

◆ More()

bool TopExp_Explorer::More ( ) const
inlinenoexcept

Returns True if there are more shapes in the exploration.

◆ Next()

void TopExp_Explorer::Next ( )

Moves to the next Shape in the exploration.

◆ ReInit()

void TopExp_Explorer::ReInit ( )
inline

Reinitialize the exploration with the original arguments.

◆ Value()

const TopoDS_Shape & TopExp_Explorer::Value ( ) const
inlinenoexcept

Returns the current shape in the exploration.


The documentation for this class was generated from the following file: