KiCad PCB EDA Suite
hed::EDGE Class Reference

Edge class in the in the half-edge data structure. More...

#include <hetriang.h>

Inheritance diagram for hed::EDGE:
hed::EDGE_MST

Public Member Functions

 EDGE ()
 Constructor. More...
 
virtual ~EDGE ()
 Destructor. More...
 
int GetTag () const
 Returns tag, common identifier for connected nodes. More...
 
void SetSourceNode (const NODE_PTR &aNode)
 Sets the source node. More...
 
void SetNextEdgeInFace (const EDGE_PTR &aEdge)
 Sets the next edge in face. More...
 
void SetTwinEdge (const EDGE_PTR &aEdge)
 Sets the twin edge. More...
 
void SetAsLeadingEdge (bool aLeading=true)
 Sets the edge as a leading edge. More...
 
bool IsLeadingEdge () const
 Checks if an edge is a leading edge. More...
 
EDGE_PTR GetTwinEdge () const
 Returns the twin edge. More...
 
void ClearTwinEdge ()
 
const EDGE_PTRGetNextEdgeInFace () const
 Returns the next edge in face. More...
 
const NODE_PTRGetSourceNode () const
 Retuns the source node. More...
 
virtual const NODE_PTRGetTargetNode () const
 Returns the target node. More...
 
void SetWeight (unsigned int weight)
 
unsigned int GetWeight () const
 
void Clear ()
 

Protected Attributes

NODE_PTR m_sourceNode
 
EDGE_WEAK_PTR m_twinEdge
 
EDGE_PTR m_nextEdgeInFace
 
unsigned int m_weight
 
bool m_isLeadingEdge
 

Detailed Description

Edge class in the in the half-edge data structure.

Definition at line 235 of file hetriang.h.

Constructor & Destructor Documentation

hed::EDGE::EDGE ( )
inline

Constructor.

Definition at line 239 of file hetriang.h.

239  : m_weight( 0 ), m_isLeadingEdge( false )
240  {
241  }
unsigned int m_weight
Definition: hetriang.h:343
bool m_isLeadingEdge
Definition: hetriang.h:344
virtual hed::EDGE::~EDGE ( )
inlinevirtual

Destructor.

Definition at line 244 of file hetriang.h.

245  {
246  }

Member Function Documentation

void hed::EDGE::Clear ( )
inline

Definition at line 327 of file hetriang.h.

References m_nextEdgeInFace, m_sourceNode, and m_twinEdge.

328  {
329  m_sourceNode.reset();
330  m_nextEdgeInFace.reset();
331 
332  if( !m_twinEdge.expired() )
333  {
334  m_twinEdge.lock()->ClearTwinEdge();
335  m_twinEdge.reset();
336  }
337  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:341
NODE_PTR m_sourceNode
Definition: hetriang.h:340
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:342
void hed::EDGE::ClearTwinEdge ( )
inline

Definition at line 294 of file hetriang.h.

References m_twinEdge.

295  {
296  m_twinEdge.reset();
297  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:341
const EDGE_PTR& hed::EDGE::GetNextEdgeInFace ( ) const
inline

Returns the next edge in face.

Definition at line 300 of file hetriang.h.

References m_nextEdgeInFace.

301  {
302  return m_nextEdgeInFace;
303  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:342
const NODE_PTR& hed::EDGE::GetSourceNode ( ) const
inline

Retuns the source node.

Definition at line 306 of file hetriang.h.

References m_sourceNode.

Referenced by GetTag().

307  {
308  return m_sourceNode;
309  }
NODE_PTR m_sourceNode
Definition: hetriang.h:340
int hed::EDGE::GetTag ( ) const
inline

Returns tag, common identifier for connected nodes.

Definition at line 249 of file hetriang.h.

References GetSourceNode(), and GetTargetNode().

250  {
251  int tag = GetSourceNode()->GetTag();
252  if( tag >= 0 )
253  return tag;
254 
255  return GetTargetNode()->GetTag();
256  }
const NODE_PTR & GetSourceNode() const
Retuns the source node.
Definition: hetriang.h:306
virtual const NODE_PTR & GetTargetNode() const
Returns the target node.
Definition: hetriang.h:312
virtual const NODE_PTR& hed::EDGE::GetTargetNode ( ) const
inlinevirtual

Returns the target node.

Reimplemented in hed::EDGE_MST.

Definition at line 312 of file hetriang.h.

References m_nextEdgeInFace.

Referenced by GetTag().

313  {
314  return m_nextEdgeInFace->GetSourceNode();
315  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:342
EDGE_PTR hed::EDGE::GetTwinEdge ( ) const
inline

Returns the twin edge.

Definition at line 289 of file hetriang.h.

References m_twinEdge.

290  {
291  return m_twinEdge.lock();
292  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:341
unsigned int hed::EDGE::GetWeight ( ) const
inline

Definition at line 322 of file hetriang.h.

References m_weight.

323  {
324  return m_weight;
325  }
unsigned int m_weight
Definition: hetriang.h:343
bool hed::EDGE::IsLeadingEdge ( ) const
inline

Checks if an edge is a leading edge.

Definition at line 283 of file hetriang.h.

References m_isLeadingEdge.

284  {
285  return m_isLeadingEdge;
286  }
bool m_isLeadingEdge
Definition: hetriang.h:344
void hed::EDGE::SetAsLeadingEdge ( bool  aLeading = true)
inline

Sets the edge as a leading edge.

Definition at line 277 of file hetriang.h.

References m_isLeadingEdge.

278  {
279  m_isLeadingEdge = aLeading;
280  }
bool m_isLeadingEdge
Definition: hetriang.h:344
void hed::EDGE::SetNextEdgeInFace ( const EDGE_PTR aEdge)
inline

Sets the next edge in face.

Definition at line 265 of file hetriang.h.

References m_nextEdgeInFace.

266  {
267  m_nextEdgeInFace = aEdge;
268  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:342
void hed::EDGE::SetSourceNode ( const NODE_PTR aNode)
inline

Sets the source node.

Definition at line 259 of file hetriang.h.

References m_sourceNode.

260  {
261  m_sourceNode = aNode;
262  }
NODE_PTR m_sourceNode
Definition: hetriang.h:340
void hed::EDGE::SetTwinEdge ( const EDGE_PTR aEdge)
inline

Sets the twin edge.

Definition at line 271 of file hetriang.h.

References m_twinEdge.

272  {
273  m_twinEdge = aEdge;
274  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:341
void hed::EDGE::SetWeight ( unsigned int  weight)
inline

Definition at line 317 of file hetriang.h.

References m_weight.

318  {
319  m_weight = weight;
320  }
unsigned int m_weight
Definition: hetriang.h:343

Member Data Documentation

bool hed::EDGE::m_isLeadingEdge
protected

Definition at line 344 of file hetriang.h.

Referenced by IsLeadingEdge(), and SetAsLeadingEdge().

EDGE_PTR hed::EDGE::m_nextEdgeInFace
protected

Definition at line 342 of file hetriang.h.

Referenced by Clear(), GetNextEdgeInFace(), GetTargetNode(), and SetNextEdgeInFace().

NODE_PTR hed::EDGE::m_sourceNode
protected

Definition at line 340 of file hetriang.h.

Referenced by Clear(), hed::EDGE_MST::EDGE_MST(), GetSourceNode(), and SetSourceNode().

EDGE_WEAK_PTR hed::EDGE::m_twinEdge
protected

Definition at line 341 of file hetriang.h.

Referenced by Clear(), ClearTwinEdge(), GetTwinEdge(), and SetTwinEdge().

unsigned int hed::EDGE::m_weight
protected

Definition at line 343 of file hetriang.h.

Referenced by hed::EDGE_MST::EDGE_MST(), GetWeight(), and SetWeight().


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