CFx SDK Documentation
2022 SP0
|
#include <DbGraph.h>
Public Member Functions | |
OdDbGraph () | |
virtual | ~OdDbGraph () |
OdDbGraphNode * | node (int nodeIndex) const |
OdDbGraphNode * | rootNode () const |
int | numNodes () const |
bool | isEmpty () const |
void | addNode (OdDbGraphNode *pNode) |
void | addEdge (OdDbGraphNode *pFrom, OdDbGraphNode *pTo) |
void | delNode (OdDbGraphNode *pNode) |
void | reset () |
void | clearAll (OdUInt8 flags) |
void | getOutgoing (OdDbGraphNodeArray &outgoing) |
virtual bool | findCycles (OdDbGraphNode *pStart=0) |
void | breakCycleEdge (OdDbGraphNode *pFrom, OdDbGraphNode *pTo) |
Protected Member Functions | |
void | clearAllCycles () |
Friends | |
class | OdDbGraphNode |
This class implements generic graph objects.
An edge connected to a node is represented as a pointer or reference to the node at the other end of the edge.
References are classified as either incoming or outgoing. Every incoming reference has a corresponding outgoing reference and vice versa.
Each GraphNode object can have any number of references associated with it, enabling the implementation of any graph structure.
Corresponding C++ library: TD_Db <group OdDb_Classes>
|
virtual |
void OdDbGraph::addEdge | ( | OdDbGraphNode * | pFrom, |
OdDbGraphNode * | pTo | ||
) |
Adds the specified edge to this Graph object.
pFrom | [in] Pointer to the GraphNode at the start of the edge. |
pTo | [in] Pointer to the GraphNode at the end of the edge. |
Throws: OdError(eInvalidOwnerObject) if the specified GraphNode objects are not in the same Graph object.
void OdDbGraph::addNode | ( | OdDbGraphNode * | pNode | ) |
Adds the specifed GraphNode object to this Graph object.
pNode | [in] Pointer to the GraphNode object. |
Throws: OdError(eInvalidOwnerObject) if the specified GraphNode object already has an owner.
void OdDbGraph::breakCycleEdge | ( | OdDbGraphNode * | pFrom, |
OdDbGraphNode * | pTo | ||
) |
pFrom | [in] Pointer to the GraphNode at the start of the edge. |
pTo | [in] Pointer to the GraphNode at the end of the edge. |
Clears the specified set flag bits in the GraphNode objects of this Graph object.
flags | [in] Flag bits. |
Value Description OdDbGraphNode::kNone 0x00 None. OdDbGraphNode::kVisited 0x01 Used internally by OdDbGraph::findCycles() and while traversing a graphs with cycles. OdDbGraphNode::kOutsideRefed 0x02 Used internally by Xref detach. OdDbGraphNode::kSelected 0x04 User selection. Set by getOutgoing. OdDbGraphNode::kInList 0x08 Is in list. Set by getOutgoing. OdDbGraphNode::kListAll 0x0E Used to clear kSelected, kInList, kOutsideRefed. OdDbGraphNode::kFirstLevel 0x10 The node is connected to the root node. Read Only. OdDbGraphNode::kUnresTree 0x20 The tree is unresolved. OdDbGraphNode::kAll 0x2F Used to clear all but kFirstLevel.
OdDbGraphNode::kListAll and OdDbGraphNode::kAll are intended to be used with this function.
|
protected |
Removes all cyclical information determined by findCycles.
\ewmarks This function does not remove cyclical edges, and is intended only for error cleanup.
void OdDbGraph::delNode | ( | OdDbGraphNode * | pNode | ) |
Removes the specified node from this GraphNode object, and all references to it.
pNode | [in] Pointer to the GraphNode object. |
|
virtual |
Finds the cyclical nodes for this Graph object.
pStart | [in] Pointer to the starting node from which to search. Usually defaulted. |
void OdDbGraph::getOutgoing | ( | OdDbGraphNodeArray & | outgoing | ) |
Adds to the specified array, the nested outgoing GraphNode objects from the specified GraphNode objects.
outgoing | [in/out] Array of GraphNode objects. |
|
inline |
|
inline |
|
inline |
void OdDbGraph::reset | ( | ) |
Removes all nodes and cycle nodes from this Graph object.
OdDbGraphNode* OdDbGraph::rootNode | ( | ) | const |
Returns the root (first) GraphNode object of this Graph object.
|
friend |