CFx SDK Documentation  2022 SP0
Public Types | Public Member Functions | Friends | List of all members
OdDbGraphNode Class Reference

#include <DbGraph.h>

Inheritance diagram for OdDbGraphNode:
OdRxObject OdDbObjectIdGraphNode OdDbXrefGraphNode

Public Types

enum  Flags {
  kNone = 0x00 , kVisited = 0x01 , kOutsideRefed = 0x02 , kSelected = 0x04 ,
  kInList = 0x08 , kListAll = 0x0E , kFirstLevel = 0x10 , kUnresTree = 0x20 ,
  kAll = 0x2F
}
 

Public Member Functions

 OdDbGraphNode ()
 
 ODRX_DECLARE_MEMBERS (OdDbGraphNode)
 
virtual ~OdDbGraphNode ()
 
voiddata () const
 
void setData (void *pData)
 
int numOut () const
 
int numIn () const
 
OdDbGraphNodein (int refIndex) const
 
OdDbGraphNodeout (int refIndex) const
 
void addRefTo (OdDbGraphNode *pTo)
 
void removeRefTo (OdDbGraphNode *pNode)
 
void disconnectAll ()
 
OdDbGraphowner () const
 
bool isMarkedAs (OdUInt8 flags) const
 
void markAs (OdUInt8 flags)
 
void clear (OdUInt8 flags)
 
void markTree (OdUInt8 flags, OdDbGraphNodeArray *pNodeArray=0)
 
int numCycleOut () const
 
int numCycleIn () const
 
OdDbGraphNodecycleIn (int refIndex) const
 
OdDbGraphNodecycleOut (int refIndex) const
 
OdDbGraphNodenextCycleNode () const
 
bool isCycleNode () const
 
- Public Member Functions inherited from OdRxObject
 ODRX_HEAP_OPERATORS ()
 
 OdRxObject ()
 
virtual ~OdRxObject ()
 
virtual OdRxObjectqueryX (const OdRxClass *pClass) const
 
virtual OdRxObjectx (const OdRxClass *pClass) const
 
virtual OdRxClassisA () const
 
virtual void addRef ()=0
 
virtual void release ()=0
 
virtual long numRefs () const
 
bool isKindOf (const OdRxClass *pClass) const
 
virtual OdRxObjectPtr clone () const
 
virtual void copyFrom (const OdRxObject *pSource)
 
virtual OdRx::Ordering comparedTo (const OdRxObject *pOther) const
 
virtual bool isEqualTo (const OdRxObject *pOther) const
 

Friends

class OdDbGraph
 
struct if_leaf_push_to
 
struct clear_cycles
 
void break_edge (OdDbGraphNode *, OdDbGraphNode *)
 

Additional Inherited Members

- Static Public Member Functions inherited from OdRxObject
static OdRxObjectPtr cast (const OdRxObject *pointer)
 
static OdRxClassdesc ()
 

Detailed Description

This class implements generic node objects for generic graphs.

Remarks
A graph consists of a collection of nodes bi-directionally linked by directional edges.

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.

See also

OdDbGraph OdDbGraphStack OdDbXrefGraph OdDbXrefGraphNode

Corresponding C++ library: TD_Db

<group OdDb_Classes>

Definition at line 71 of file DbGraph.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kNone 
kVisited 
kOutsideRefed 
kSelected 
kInList 
kListAll 
kFirstLevel 
kUnresTree 
kAll 

Definition at line 81 of file DbGraph.h.

Constructor & Destructor Documentation

◆ OdDbGraphNode()

OdDbGraphNode::OdDbGraphNode ( )
inline

Definition at line 75 of file DbGraph.h.

◆ ~OdDbGraphNode()

virtual OdDbGraphNode::~OdDbGraphNode ( )
virtual

Member Function Documentation

◆ addRefTo()

void OdDbGraphNode::addRefTo ( OdDbGraphNode pTo)

Creates an outgoing reference, in this GraphNode object, to the specified GraphNode object.

Parameters
pTo[in] Pointer to the outgoing GraphNode.
Remarks
Creates an incoming reference to this GraphNode object in *pTo.

Throws: OdError(eInvalidOwnerObject) if the specified GraphNode object are not in the same Graph object as this GraphNode object.

See also
OdDbGraph::addEdge

◆ clear()

void OdDbGraphNode::clear ( OdUInt8  flags)
inline

Clears the specified set flag bits in this GraphNode object.

Parameters
flags[in] Flag bits.
Remarks
flags must be a combination of one or more of the following:

Value Description kNone 0x00 None. kVisited 0x01 Used internally by OdDbGraph::findCycles() and while traversing a graphs with cycles. kOutsideRefed 0x02 Used internally by Xref detach. kSelected 0x04 User selection. Set by getOutgoing. kInList 0x08 Is in list. Set by getOutgoing. kListAll 0x0E Used to clear kSelected, kInList, kOutsideRefed. kFirstLevel 0x10 The node is connected to the root node. Read Only. kUnresTree 0x20 The tree is unresolved. kAll 0x2F Used to clear all but kFirstLevel.

Definition at line 261 of file DbGraph.h.

◆ cycleIn()

OdDbGraphNode* OdDbGraphNode::cycleIn ( int  refIndex) const
inline

Returns the specified incoming cyclical reference of this GraphNode object.

Parameters
refIndex[in] Reference index.
Returns
Returns a null pointer if and only if the index is not valid.
Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 342 of file DbGraph.h.

◆ cycleOut()

OdDbGraphNode* OdDbGraphNode::cycleOut ( int  refIndex) const
inline

Returns the specified outgoing cyclical reference of this GraphNode object.

Parameters
refIndex[in] Reference index.
Returns
Returns a null pointer if and only if the index is not valid.
Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 357 of file DbGraph.h.

◆ data()

void* OdDbGraphNode::data ( ) const
inline

Returns the data associated with this GraphNode object.

Definition at line 97 of file DbGraph.h.

◆ disconnectAll()

void OdDbGraphNode::disconnectAll ( )

Removes all references in and to this GraphNode object.

Remarks
Always called by ~OdDbGraphNode().

◆ in()

OdDbGraphNode* OdDbGraphNode::in ( int  refIndex) const
inline

Returns the specified incoming reference of this GraphNode object.

Parameters
refIndex[in] Reference index.
Remarks
Returns a null pointer if and only if the index is not valid.

Definition at line 125 of file DbGraph.h.

◆ isCycleNode()

bool OdDbGraphNode::isCycleNode ( ) const
inline

Returns true if and only if this GraphNode object is part of a cyclical reference.

Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 379 of file DbGraph.h.

◆ isMarkedAs()

bool OdDbGraphNode::isMarkedAs ( OdUInt8  flags) const
inline

Returns true if and only if the all the specified set flag bits are set in this GraphNode object.

Parameters
flags[in] Flag bits.
Remarks
flags must be a combination of one or more of the following:

Value Description kNone 0x00 None. kVisited 0x01 Used internally by OdDbGraph::findCycles() and while traversing a graphs with cycles. kOutsideRefed 0x02 Used internally by Xref detach. kSelected 0x04 User selection. Set by getOutgoing. kInList 0x08 Is in list. Set by getOutgoing. kListAll 0x0E Used to clear kSelected, kInList, kOutsideRefed. kFirstLevel 0x10 The node is connected to the root node. Read Only. kUnresTree 0x20 The tree is unresolved. kAll 0x2F Used to clear all but kFirstLevel.

Definition at line 203 of file DbGraph.h.

◆ markAs()

void OdDbGraphNode::markAs ( OdUInt8  flags)
inline

Sets the specified set flag bits in this GraphNode object.

Parameters
flags[in] Flag bits.
Remarks
flags must be a combination of one or more of the following:

Value Description kNone 0x00 None. kVisited 0x01 Used internally by OdDbGraph::findCycles() and while traversing a graphs with cycles. kOutsideRefed 0x02 Used internally by Xref detach. kSelected 0x04 User selection. Set by getOutgoing. kInList 0x08 Is in list. Set by getOutgoing. kListAll 0x0E Used to clear kSelected, kInList, kOutsideRefed. kFirstLevel 0x10 The node is connected to the root node. Read Only. kUnresTree 0x20 The tree is unresolved. kAll 0x2F Used to clear all but kFirstLevel.

Definition at line 227 of file DbGraph.h.

◆ markTree()

void OdDbGraphNode::markTree ( OdUInt8  flags,
OdDbGraphNodeArray pNodeArray = 0 
)

Marks this GraphNode object and all nested outgoing GraphNode objects with the specified flags.

Parameters
flags[in] Flag bits.
pNodeArray[in] Pointer to a GraphNode array.
Remarks
If pNodeArray is specified, this function appends this GraphNode object and all nested outgoing GraphNode objects, to the specified array. While tranversing a branch, if any GraphNode object already has the flag bits set, the branch is no longer followed.

The user must clear the flags with OdDbGraph::clearAll() or OdDbGraphNode::clear() when done with them.

flags must be a combination of one or more of the following:

Value Description kNone 0x00 None. kVisited 0x01 Used internally by OdDbGraph::findCycles() and while traversing a graphs with cycles. kOutsideRefed 0x02 Used internally by Xref detach. kSelected 0x04 User selection. Set by getOutgoing. kInList 0x08 Is in list. Set by getOutgoing. kListAll 0x0E Used to clear kSelected, kInList, kOutsideRefed. kFirstLevel 0x10 The node is connected to the root node. Read Only. kUnresTree 0x20 The tree is unresolved. kAll 0x2F Used to clear all but kFirstLevel.

Remarks
This function is not implemented, and will generate a link error if you reference it.

◆ nextCycleNode()

OdDbGraphNode* OdDbGraphNode::nextCycleNode ( ) const
inline

Returns the next outgoing cyclical reference of this GraphNode object.

Returns
This function returns cycleOut(0). Returns a null pointer if cycleOut(0) == 0.
Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 370 of file DbGraph.h.

◆ numCycleIn()

int OdDbGraphNode::numCycleIn ( ) const
inline

Returns the number of incoming cyclical references associated with this GraphNode object.

Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 328 of file DbGraph.h.

◆ numCycleOut()

int OdDbGraphNode::numCycleOut ( ) const
inline

Returns the number of outgoing cyclical references associated with this GraphNode object.

Remarks
This function returns valid results only if OdDbGraph::findCycles() has been called with no intervening changes to the graph.

Definition at line 319 of file DbGraph.h.

◆ numIn()

int OdDbGraphNode::numIn ( ) const
inline

Return the number of incoming references associated with this GraphNode object.

Definition at line 115 of file DbGraph.h.

◆ numOut()

int OdDbGraphNode::numOut ( ) const
inline

Return the number of outgoing references associated with this GraphNode object.

Definition at line 110 of file DbGraph.h.

◆ ODRX_DECLARE_MEMBERS()

OdDbGraphNode::ODRX_DECLARE_MEMBERS ( OdDbGraphNode  )

◆ out()

OdDbGraphNode* OdDbGraphNode::out ( int  refIndex) const
inline

Returns the specified outgoing reference of this GraphNode object.

Parameters
refIndex[in] Reference index.
Remarks
Returns a null pointer if and only if the index is not valid.

Definition at line 135 of file DbGraph.h.

◆ owner()

OdDbGraph* OdDbGraphNode::owner ( ) const
inline

Returns the Graph object to which this GraphNode object is attached.

Definition at line 180 of file DbGraph.h.

◆ removeRefTo()

void OdDbGraphNode::removeRefTo ( OdDbGraphNode pNode)

Removes the outgoing reference, in this GraphNode object, to the specified GraphNode object.

Parameters
pTo[in] Pointer to the outgoing GraphNode.
Remarks
Removes the incoming reference to this GraphNode object in the outgoing GraphNode object.

The specified GraphNode object must be part of the same graph as this GraphNode object.

◆ setData()

void OdDbGraphNode::setData ( void pData)
inline

Sets the data associated with this GraphNode object.

Parameters
pData[in] Pointer to the data.

Definition at line 104 of file DbGraph.h.

Friends And Related Function Documentation

◆ break_edge

void break_edge ( OdDbGraphNode ,
OdDbGraphNode  
)
friend

◆ clear_cycles

friend struct clear_cycles
friend

Definition at line 394 of file DbGraph.h.

◆ if_leaf_push_to

friend struct if_leaf_push_to
friend

Definition at line 393 of file DbGraph.h.

◆ OdDbGraph

friend class OdDbGraph
friend

Definition at line 73 of file DbGraph.h.


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