GraphEdgeBase< NODE > Class Template Reference

#include <graphbase.h>

详细描述

template<typename NODE>
class maxon::GraphEdgeBase< NODE >

Basic edge template for a graph, in case of custom implementation have to be frowarded to the node type.

Template Parameters
NODE The node type in the graph.

Public Types

typedef GraphEdgeBase < NODE >  EdgeType

公共成员函数

  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 ( 向量 &p1, 向量 &p2) const
Float   GetLength () const
Result < NODE * >  GetOtherHand (NODE *point, Bool *secondPoint=nullptr) const
Bool   IsEqual (NODE *p1, NODE *p2) const
void  重置 ()

Protected Attributes

NODE *  _p1
NODE *  _p2

Member Typedef Documentation

◆  EdgeType

typedef GraphEdgeBase <NODE> EdgeType

构造函数 & 析构函数文档编制

◆  GraphEdgeBase() [1/2]

GraphEdgeBase ( NODE *  p1 = nullptr ,
NODE *  p2 = nullptr  
)
explicit

◆  ~GraphEdgeBase()

~ GraphEdgeBase ( )

◆  GraphEdgeBase() [2/2]

GraphEdgeBase ( GraphEdgeBase < NODE > &&  src )

成员函数文档编制

◆  CopyFrom()

Result <void> CopyFrom ( const GraphEdgeBase < NODE > &  src )

◆  UpdateNodes()

Result <void> UpdateNodes ( NODE *  p1 ,
NODE *  p2  
)

Update node pointers used after consistency check.

参数
[in] p1 First edge node.
[in] p2 Second edge node.
返回
OK if both nodes are not nullptr otherwise error.

◆  IsValid()

Bool IsValid ( ) const

Check if the edge is in between 2 valid points.

返回
True if edge is valid otherwise false.

◆  GetNodes()

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.
返回
OK if both nodes are not nullptr otherwise error.

◆  GetNodesPointer()

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.
返回
OK if both nodes are not nullptr otherwise error.

◆  GetNodesPos()

Result <void> GetNodesPos ( 向量 p1 ,
向量 p2  
) const

Get the tow main node position for this edge.

参数
[out] p1 First node to be filled.
[out] p2 Second node to be filled.
返回
OK if both nodes are not nullptr otherwise error.

◆  GetLength()

Float GetLength ( ) const

Calculate the distance in between _p1 and _p2.

返回
The stroke length.

◆  GetOtherHand()

Result <NODE*> GetOtherHand ( NODE *  point ,
Bool secondPoint = nullptr  
) const

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.
返回
The opposite side of edge otherwise error.

◆  IsEqual()

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.
返回
True if this edge is in between p1 and p2. otherwise false.

◆  Reset()

void Reset ( )

Free memory and reset all values.

Member Data Documentation

◆  _p1

NODE* _p1 protected

◆  _p2

NODE* _p2 protected