#include <graphbase.h>
Basic node template for a graph, reppresent a node with attached strokes pointers list basically an node with an adjacency list.
| NODEDATA | Custom Data attched to the node. |
| EDGE | Edge type have to be GraphEdgeBase<this->Type>. |
Public Types | |
| typedef GraphNodeBase< NODEDATA, EDGE > | NodeType |
Public Member Functions | |
| GraphNodeBase () | |
| GraphNodeBase (const NODEDATA &data, Vector pos=Vector()) | |
| ~GraphNodeBase () | |
| GraphNodeBase (GraphNodeBase &&src) | |
| Result< void > | CopyFrom (const GraphNodeBase &src) |
| Vector | GetPosition () const |
| void | SetPosition (const Vector &pos) |
| Int | GetEdgesCount () const |
| Result< EDGE * > | GetEdge (Int pos) const |
| Result< NodeType * > | GetNeighbor (Int pos) const |
| Result< EDGE * > | FindEdge (NodeType *otherHand) |
| Result< void > | AddEdge (EDGE *edge) |
| Result< void > | DeleteEdge (Int32 pos) |
| Result< void > | DeleteEdge (EDGE *edge) |
| const NODEDATA * | GetData () const |
| Result< void > | SetData (const NODEDATA &data) |
| void | Visit () |
| void | Unvisit () |
| Bool | IsVisited () const |
| void | Reset () |
Protected Attributes | |
| NODEDATA | _data |
| Vector | _pos |
| Bool | _visited |
| BaseArray< EDGE * > | _edges |
| typedef GraphNodeBase<NODEDATA, EDGE> NodeType |
|
explicit |
|
explicit |
| ~GraphNodeBase | ( | ) |
| GraphNodeBase | ( | GraphNodeBase< NODEDATA, EDGE > && | src | ) |
| Result<void> CopyFrom | ( | const GraphNodeBase< NODEDATA, EDGE > & | src | ) |
| Vector GetPosition | ( | ) | const |
Get the Node position.
| void SetPosition | ( | const Vector & | pos | ) |
Set the Node position.
| [in] | pos | The new Node position. |
| Int GetEdgesCount | ( | ) | const |
Get the edges count for this point.
Get the edges at pos in the list.
| [in] | pos | The edge index position. |
Get The other hand of the edge at index pos.
| [in] | pos | the edge index. |
Find an edge in between this node and otherHand node.
| [in] | otherHand | The other node which create the edge. |
| Result<void> AddEdge | ( | EDGE * | edge | ) |
Add a new edges to the point.
| [in] | edge | The edge to add. |
Remove the edge at pos.
| [in] | pos | The edge list index. |
| Result<void> DeleteEdge | ( | EDGE * | edge | ) |
Remove edge form the list.
| [in] | edge | The edge to be removed. |
| const NODEDATA* GetData | ( | ) | const |
Get a pointer to user data.
| Result<void> SetData | ( | const NODEDATA & | data | ) |
Replace current user data with the passed one, data is duplicated.
| [in] | data | The new data to be used. |
| void Visit | ( | ) |
Process this node.
| void Unvisit | ( | ) |
Reset the processing status.
| Bool IsVisited | ( | ) | const |
Get the processing status.
| void Reset | ( | ) |
Free memory and reset all values, could be extended for each implementation.
|
protected |
|
protected |
|
protected |
|
protected |