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

Iterator for traversing wire edges in connection order using graph data. More...

#include <BRepGraph_WireExplorer.hxx>

Public Member Functions

 BRepGraph_WireExplorer (const BRepGraph &theGraph, const BRepGraph_WireId theWire)
 Initialize the explorer from a pre-built BRepGraph and wire identifier. Collects coedge IDs from graph iterators and reorders them by vertex connectivity.
 
bool More () const
 Returns true if there are more edges to iterate.
 
void Next ()
 Advance to the next edge.
 
void Reset ()
 Reset the iterator to the beginning (for re-iteration).
 
BRepGraph_CoEdgeId CurrentCoEdgeId () const
 Current coedge definition identifier in connection order.
 
int NbEdges () const
 Number of coedges in the ordered sequence.
 
BRepGraph_CoEdgeId Current () const
 Current coedge identifier (alias for CurrentCoEdgeId(), enables range-for).
 
NCollection_ForwardRangeIterator< BRepGraph_WireExplorerbegin ()
 Returns an STL-compatible iterator for range-based for loops. Yields BRepGraph_CoEdgeId values.
 
NCollection_ForwardRangeSentinel end () const
 Returns a sentinel marking the end of iteration.
 

Detailed Description

Iterator for traversing wire edges in connection order using graph data.

See also
BRepGraph class comment "Iterator guide" for choosing between iterator types.

Reorders wire coedges by vertex adjacency: the end vertex of each edge matches the start vertex of the next. This is the graph equivalent of BRepTools_WireExplorer, operating on pre-built BRepGraph data.

The coedges are reordered on construction (O(N^2) worst case for N coedges). For most wires this is fast since N is small (4-8 edges typically).

Internal storage uses NCollection_LocalArray with stack allocation for wires with up to 16 edges (the common case), falling back to heap for larger wires.

Usage:

for (; anExp.More(); anExp.Next())
{
const BRepGraph_CoEdgeId aCoEdgeId = anExp.CurrentCoEdgeId();
const BRepGraphInc::CoEdgeDef& aDef = aGraph.Topo().CoEdges().Definition(aCoEdgeId);
// ... use aDef ...
}
Iterator for traversing wire edges in connection order using graph data.
Definition BRepGraph_WireExplorer.hxx:50
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
CoEdge entity: use of an edge on a specific face, owns PCurve data.
Definition BRepGraphInc_Definition.hxx:141

Constructor & Destructor Documentation

◆ BRepGraph_WireExplorer()

BRepGraph_WireExplorer::BRepGraph_WireExplorer ( const BRepGraph & theGraph,
const BRepGraph_WireId theWire )
inline

Initialize the explorer from a pre-built BRepGraph and wire identifier. Collects coedge IDs from graph iterators and reorders them by vertex connectivity.

Parameters
[in]theGraphpre-built BRepGraph (IsDone() == true)
[in]theWirewire definition identifier

Member Function Documentation

◆ begin()

NCollection_ForwardRangeIterator< BRepGraph_WireExplorer > BRepGraph_WireExplorer::begin ( )
inline

Returns an STL-compatible iterator for range-based for loops. Yields BRepGraph_CoEdgeId values.

◆ Current()

BRepGraph_CoEdgeId BRepGraph_WireExplorer::Current ( ) const
inline

Current coedge identifier (alias for CurrentCoEdgeId(), enables range-for).

◆ CurrentCoEdgeId()

BRepGraph_CoEdgeId BRepGraph_WireExplorer::CurrentCoEdgeId ( ) const
inline

Current coedge definition identifier in connection order.

◆ end()

NCollection_ForwardRangeSentinel BRepGraph_WireExplorer::end ( ) const
inline

Returns a sentinel marking the end of iteration.

◆ More()

bool BRepGraph_WireExplorer::More ( ) const
inline

Returns true if there are more edges to iterate.

◆ NbEdges()

int BRepGraph_WireExplorer::NbEdges ( ) const
inline

Number of coedges in the ordered sequence.

◆ Next()

void BRepGraph_WireExplorer::Next ( )
inline

Advance to the next edge.

◆ Reset()

void BRepGraph_WireExplorer::Reset ( )
inline

Reset the iterator to the beginning (for re-iteration).


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