Provides generic methods for traversing assembly tree and graph.
More...
#include <XCAFDoc_AssemblyTool.hxx>
|
template<typename Func > |
static void | Traverse (XCAFDoc_AssemblyIterator theIterator, Func theFunc) |
| Generic method for traversing assembly tree. Performs in-depth traversing of the assembly tree and calls user defined function for each assembly tree node. User function takes single argument of XCAFDoc_AssemblyItemId type and returns true/false to continue/break.
|
|
template<typename Func , typename Filter > |
static void | Traverse (const Handle< XCAFDoc_AssemblyGraph > &theGraph, Filter theFilter, Func theFunc, const Standard_Integer theNode=1) |
| Generic method for traversing assembly graph. Performs in-depth traversing of the assembly graph beginning from root nodes and calls user defined function for each assembly graph node accepted by the user defined filtering function. Filtering function takes the assembly graph passed for traversing, current graph node ID and returns true/false to accept/reject node.
|
|
Provides generic methods for traversing assembly tree and graph.
◆ Traverse() [1/2]
template<typename Func , typename Filter >
Generic method for traversing assembly graph. Performs in-depth traversing of the assembly graph beginning from root nodes and calls user defined function for each assembly graph node accepted by the user defined filtering function. Filtering function takes the assembly graph passed for traversing, current graph node ID and returns true/false to accept/reject node.
{
}
#define Handle(Class)
Define Handle() macro.
Definition Standard_Handle.hxx:399
bool Standard_Boolean
Definition Standard_TypeDef.hxx:64
int Standard_Integer
Definition Standard_TypeDef.hxx:61
Definition XCAFDoc_AssemblyGraph.hxx:35
NodeType GetNodeType(const Standard_Integer theNode) const
Returns the node type from NodeType enum.
@ NodeType_Part
Leaf node to represent parts.
Definition XCAFDoc_AssemblyGraph.hxx:45
User function theFunc takes the assembly graph passed for traversing, current graph node ID and returns true/false to continue/break.
- Parameters
-
[in] | theGraph | - assembly graph. |
[in] | theFilter | - user filtering function called for each assembly graph node. |
[in] | theFunc | - user function called for accepted assembly graph node. |
[in] | theNode | - starting positive one-based graph node ID. |
◆ Traverse() [2/2]
Generic method for traversing assembly tree. Performs in-depth traversing of the assembly tree and calls user defined function for each assembly tree node. User function takes single argument of XCAFDoc_AssemblyItemId type and returns true/false to continue/break.
{
std::cout << theItem.
ToString() << std::endl;
}
#define Standard_True
Definition Standard_TypeDef.hxx:57
Unique item identifier in the hierarchical product structure. A full path to an assembly component in...
Definition XCAFDoc_AssemblyItemId.hxx:26
TCollection_AsciiString ToString() const
Returns the full pass as a formatted string.
- Parameters
-
[in] | theIterator | - starting position in the assembly tree. |
[in] | theFunc | - user function called for each assembly tree node. |
The documentation for this class was generated from the following file: