#include <graphbase.h>
Basic edge template for a graph, in case of custom implementation have to be frowarded to the node type.
NODE | The node type in the graph. |
Public Types | |
typedef GraphEdgeBase< NODE > | EdgeType |
Public Member Functions | |
GraphEdgeBase (NODE *p1=nullptr, NODE *p2=nullptr) | |
~GraphEdgeBase () | |
GraphEdgeBase (GraphEdgeBase &&src) | |
Result< void > | CopyFrom (const GraphEdgeBase &src) |
Result< void > | UpdateNodes (NODE *p1, NODE *p2) |
Bool | IsValid () const |
Result< void > | GetNodes (NODE &p1, NODE &p2) const |
Result< void > | GetNodesPointer (NODE *&p1, NODE *&p2) const |
Result< void > | GetNodesPos (Vector &p1, Vector &p2) const |
Float | GetLength () const |
Result< NODE * > | GetOtherHand (NODE *point, Bool *secondPoint=nullptr) const |
Bool | IsEqual (NODE *p1, NODE *p2) const |
void | Reset () |
Protected Attributes | |
NODE * | _p1 |
NODE * | _p2 |
typedef GraphEdgeBase<NODE> EdgeType |
|
explicit |
~GraphEdgeBase | ( | ) |
GraphEdgeBase | ( | GraphEdgeBase< NODE > && | src | ) |
Result<void> CopyFrom | ( | const GraphEdgeBase< NODE > & | src | ) |
Result<void> UpdateNodes | ( | NODE * | p1, |
NODE * | p2 | ||
) |
Update node pointers used after consistency check.
[in] | p1 | First edge node. |
[in] | p2 | Second edge node. |
Bool IsValid | ( | ) | const |
Check if the edge is in between 2 valid points.
Result<void> GetNodes | ( | NODE & | p1, |
NODE & | p2 | ||
) | const |
Get the tow main nodes for this edge (copy all data).
[out] | p1 | First node to be filled. |
[out] | p2 | Second node to be filled. |
Result<void> GetNodesPointer | ( | NODE *& | p1, |
NODE *& | p2 | ||
) | const |
Get the tow main ndoes for this edge.
[out] | p1 | First node to be filled. |
[out] | p2 | Second node to be filled. |
Get the tow main node position for this edge.
[out] | p1 | First node to be filled. |
[out] | p2 | Second node to be filled. |
Float GetLength | ( | ) | const |
Calculate the distance in between _p1 and _p2.
Return a node pointer on opposite side of the edge.
[in] | point | The original point. |
[out] | secondPoint | If passed the function set it true if the other hand is _p2 otherwise false. |
Bool IsEqual | ( | NODE * | p1, |
NODE * | p2 | ||
) | const |
Return true if the edge is in between p1 and p2.
[in] | p1 | First edge point to check. |
[in] | p2 | Second edge point to check. |
void Reset | ( | ) |
Free memory and reset all values.
|
protected |
|
protected |