KiCad PCB EDA Suite
hed::EDGE_MST Class Reference

Specialization of EDGE class to be used for Minimum Spanning Tree algorithm. More...

#include <hetriang.h>

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

Public Member Functions

 EDGE_MST (const NODE_PTR &aSource, const NODE_PTR &aTarget, unsigned int aWeight=0)
 
virtual const NODE_PTRGetTargetNode () const override
 
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...
 
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
 

Private Member Functions

 EDGE_MST (const EDGE &aEdge)
 

Private Attributes

NODE_PTR m_target
 

Detailed Description

Specialization of EDGE class to be used for Minimum Spanning Tree algorithm.

Definition at line 352 of file hetriang.h.

Constructor & Destructor Documentation

hed::EDGE_MST::EDGE_MST ( const NODE_PTR aSource,
const NODE_PTR aTarget,
unsigned int  aWeight = 0 
)
inline

Definition at line 358 of file hetriang.h.

References hed::EDGE::m_sourceNode, and hed::EDGE::m_weight.

358  :
359  m_target( aTarget )
360  {
361  m_sourceNode = aSource;
362  m_weight = aWeight;
363  }
unsigned int m_weight
Definition: hetriang.h:343
NODE_PTR m_target
Definition: hetriang.h:355
NODE_PTR m_sourceNode
Definition: hetriang.h:340
hed::EDGE_MST::EDGE_MST ( const EDGE aEdge)
inlineprivate

Definition at line 372 of file hetriang.h.

373  {
374  assert( false );
375  }

Member Function Documentation

void hed::EDGE::Clear ( )
inlineinherited

Definition at line 327 of file hetriang.h.

References hed::EDGE::m_nextEdgeInFace, hed::EDGE::m_sourceNode, and hed::EDGE::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 ( )
inlineinherited

Definition at line 294 of file hetriang.h.

References hed::EDGE::m_twinEdge.

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

Returns the next edge in face.

Definition at line 300 of file hetriang.h.

References hed::EDGE::m_nextEdgeInFace.

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

Retuns the source node.

Definition at line 306 of file hetriang.h.

References hed::EDGE::m_sourceNode.

Referenced by hed::EDGE::GetTag().

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

Returns tag, common identifier for connected nodes.

Definition at line 249 of file hetriang.h.

References hed::EDGE::GetSourceNode(), and hed::EDGE::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_MST::GetTargetNode ( ) const
inlineoverridevirtual

Reimplemented from hed::EDGE.

Definition at line 366 of file hetriang.h.

References m_target.

367  {
368  return m_target;
369  }
NODE_PTR m_target
Definition: hetriang.h:355
EDGE_PTR hed::EDGE::GetTwinEdge ( ) const
inlineinherited

Returns the twin edge.

Definition at line 289 of file hetriang.h.

References hed::EDGE::m_twinEdge.

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

Definition at line 322 of file hetriang.h.

References hed::EDGE::m_weight.

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

Checks if an edge is a leading edge.

Definition at line 283 of file hetriang.h.

References hed::EDGE::m_isLeadingEdge.

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

Sets the edge as a leading edge.

Definition at line 277 of file hetriang.h.

References hed::EDGE::m_isLeadingEdge.

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

Sets the next edge in face.

Definition at line 265 of file hetriang.h.

References hed::EDGE::m_nextEdgeInFace.

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

Sets the source node.

Definition at line 259 of file hetriang.h.

References hed::EDGE::m_sourceNode.

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

Sets the twin edge.

Definition at line 271 of file hetriang.h.

References hed::EDGE::m_twinEdge.

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

Definition at line 317 of file hetriang.h.

References hed::EDGE::m_weight.

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

Member Data Documentation

bool hed::EDGE::m_isLeadingEdge
protectedinherited

Definition at line 344 of file hetriang.h.

Referenced by hed::EDGE::IsLeadingEdge(), and hed::EDGE::SetAsLeadingEdge().

EDGE_PTR hed::EDGE::m_nextEdgeInFace
protectedinherited
NODE_PTR hed::EDGE::m_sourceNode
protectedinherited
NODE_PTR hed::EDGE_MST::m_target
private

Definition at line 355 of file hetriang.h.

Referenced by GetTargetNode().

EDGE_WEAK_PTR hed::EDGE::m_twinEdge
protectedinherited
unsigned int hed::EDGE::m_weight
protectedinherited

Definition at line 343 of file hetriang.h.

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


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