![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Upward occurrence-aware parent traversal for BRepGraph. More...
#include <BRepGraph_ParentExplorer.hxx>
Data Structures | |
| struct | Config |
| Consolidated configuration for the explorer. More... | |
Public Types | |
| enum class | LinkKind { None , Reference , Structural } |
| Relationship kind between Current() and CurrentChild(). More... | |
| enum class | TraversalMode { Recursive , DirectParents } |
| Upward traversal strategy. More... | |
Public Member Functions | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, const Config &theConfig) | |
Preferred long-term constructor: all tuning knobs in Config. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode) | |
| Explore all parents of the starting node. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, TraversalMode theMode) | |
| Explore parents of the starting node using the given traversal mode. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, const std::optional< BRepGraph_NodeId::Kind > &theAvoidKind, bool theEmitAvoidKind, TraversalMode theMode=TraversalMode::Recursive) | |
| Explore all parents while pruning branches at the avoid kind. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, BRepGraph_NodeId::Kind theTargetKind) | |
| Explore only parents of the given kind. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, BRepGraph_NodeId::Kind theTargetKind, TraversalMode theMode) | |
| Explore only parents of the given kind using the given traversal mode. | |
| BRepGraph_ParentExplorer (const BRepGraph &theGraph, const BRepGraph_NodeId theNode, BRepGraph_NodeId::Kind theTargetKind, const std::optional< BRepGraph_NodeId::Kind > &theAvoidKind, bool theEmitAvoidKind, TraversalMode theMode=TraversalMode::Recursive) | |
| Explore parents of the given kind while pruning branches at the avoid kind. | |
| const Config & | GetConfig () const |
| Returns the traversal configuration this explorer was constructed with. Read-only - configuration is fixed for the lifetime of the explorer. | |
| bool | More () const |
| True if another matching parent is available. | |
| void | Next () |
| Advance to the next matching parent. | |
| BRepGraphInc::NodeInstance | Current () const |
| Current matching ancestor node with accumulated location and orientation. | |
| BRepGraph_NodeId | CurrentChild () const |
| Returns the immediate child of Current() on the currently emitted branch. Returns invalid NodeId when no current ancestor is available. | |
| LinkKind | CurrentLinkKind () const |
| Returns how Current() is linked to CurrentChild(). | |
| BRepGraph_RefId | CurrentRef () const |
| Returns the exact parent-owned RefId linking Current() to CurrentChild(), when that branch step is represented by a reference entry. | |
| const TopLoc_Location & | LeafLocation () const |
| Accumulated location at the starting node of the current branch. | |
| TopAbs_Orientation | LeafOrientation () const |
| Accumulated orientation at the starting node of the current branch. | |
| bool | IsCurrentBranchRoot () const |
| True if Current() is the explicit root node of the current branch. | |
| NCollection_ForwardRangeIterator< BRepGraph_ParentExplorer > | begin () |
| Returns an STL-compatible iterator for range-based for loops. | |
| NCollection_ForwardRangeSentinel | end () const |
| Returns a sentinel marking the end of iteration. | |
Upward occurrence-aware parent traversal for BRepGraph.
Enumerates all ancestor nodes reachable from a starting node. Traversal is path-aware: when the same definition is reached through multiple occurrence paths, each path contributes its own parent sequence with its own accumulated location and orientation.
The traversal follows the actual graph structure transparently - every node kind is visited as a distinct entity (no hidden collapses): Vertex -> Edge, Edge -> CoEdge, CoEdge -> Wire, Wire -> Face, Face -> Shell, Shell -> Solid, Solid -> CompSolid/Compound, Product -> Occurrence, Occurrence -> Product (parent assembly).
Relationship kind between Current() and CurrentChild().
| Enumerator | |
|---|---|
| None | No current branch step. |
| Reference | Current() owns CurrentChild() through a RefId. |
| Structural | Current() reaches CurrentChild() through a structural non-ref link. |
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| const Config & | theConfig ) |
Preferred long-term constructor: all tuning knobs in Config.
| [in] | theGraph | graph to walk |
| [in] | theNode | starting node whose ancestors are explored |
| [in] | theConfig | traversal configuration |
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode ) |
Explore all parents of the starting node.
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| TraversalMode | theMode ) |
Explore parents of the starting node using the given traversal mode.
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| const std::optional< BRepGraph_NodeId::Kind > & | theAvoidKind, | ||
| bool | theEmitAvoidKind, | ||
| TraversalMode | theMode = TraversalMode::Recursive ) |
Explore all parents while pruning branches at the avoid kind.
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| BRepGraph_NodeId::Kind | theTargetKind ) |
Explore only parents of the given kind.
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| BRepGraph_NodeId::Kind | theTargetKind, | ||
| TraversalMode | theMode ) |
Explore only parents of the given kind using the given traversal mode.
| BRepGraph_ParentExplorer::BRepGraph_ParentExplorer | ( | const BRepGraph & | theGraph, |
| const BRepGraph_NodeId | theNode, | ||
| BRepGraph_NodeId::Kind | theTargetKind, | ||
| const std::optional< BRepGraph_NodeId::Kind > & | theAvoidKind, | ||
| bool | theEmitAvoidKind, | ||
| TraversalMode | theMode = TraversalMode::Recursive ) |
Explore parents of the given kind while pruning branches at the avoid kind.
|
inline |
Returns an STL-compatible iterator for range-based for loops.
|
inline |
Current matching ancestor node with accumulated location and orientation.
| BRepGraph_NodeId BRepGraph_ParentExplorer::CurrentChild | ( | ) | const |
Returns the immediate child of Current() on the currently emitted branch. Returns invalid NodeId when no current ancestor is available.
| LinkKind BRepGraph_ParentExplorer::CurrentLinkKind | ( | ) | const |
Returns how Current() is linked to CurrentChild().
| BRepGraph_RefId BRepGraph_ParentExplorer::CurrentRef | ( | ) | const |
Returns the exact parent-owned RefId linking Current() to CurrentChild(), when that branch step is represented by a reference entry.
Some upward steps are structural and therefore have no parent-owned ref entry even though the parent itself is still emitted by the explorer. In those cases this method returns an invalid RefId, for example for CoEdge->Edge, Product(part)->ShapeRoot and Occurrence->Product.
|
inline |
Returns a sentinel marking the end of iteration.
|
inline |
Returns the traversal configuration this explorer was constructed with. Read-only - configuration is fixed for the lifetime of the explorer.
| bool BRepGraph_ParentExplorer::IsCurrentBranchRoot | ( | ) | const |
True if Current() is the explicit root node of the current branch.
| const TopLoc_Location & BRepGraph_ParentExplorer::LeafLocation | ( | ) | const |
Accumulated location at the starting node of the current branch.
| TopAbs_Orientation BRepGraph_ParentExplorer::LeafOrientation | ( | ) | const |
Accumulated orientation at the starting node of the current branch.
|
inline |
True if another matching parent is available.
| void BRepGraph_ParentExplorer::Next | ( | ) |
Advance to the next matching parent.