KiCad PCB EDA Suite
hed::EDGE Class Reference

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

#include <hetriang.h>

Public Member Functions

 EDGE ()
 Constructor. More...
 
virtual ~EDGE ()
 Destructor. 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 Clear ()
 

Protected Attributes

NODE_PTR m_sourceNode
 
EDGE_WEAK_PTR m_twinEdge
 
EDGE_PTR m_nextEdgeInFace
 
bool m_isLeadingEdge
 

Detailed Description

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

Definition at line 179 of file hetriang.h.

Constructor & Destructor Documentation

hed::EDGE::EDGE ( )
inline

Constructor.

Definition at line 183 of file hetriang.h.

183  : m_isLeadingEdge( false )
184  {
185  }
bool m_isLeadingEdge
Definition: hetriang.h:272
virtual hed::EDGE::~EDGE ( )
inlinevirtual

Destructor.

Definition at line 188 of file hetriang.h.

189  {
190 
191  }

Member Function Documentation

void hed::EDGE::Clear ( )
inline

Definition at line 256 of file hetriang.h.

References m_nextEdgeInFace, m_sourceNode, and m_twinEdge.

257  {
258  m_sourceNode.reset();
259  m_nextEdgeInFace.reset();
260 
261  if( !m_twinEdge.expired() )
262  {
263  m_twinEdge.lock()->ClearTwinEdge();
264  m_twinEdge.reset();
265  }
266  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:270
NODE_PTR m_sourceNode
Definition: hetriang.h:269
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:271
void hed::EDGE::ClearTwinEdge ( )
inline

Definition at line 232 of file hetriang.h.

References m_twinEdge.

233  {
234  m_twinEdge.reset();
235  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:270
const EDGE_PTR& hed::EDGE::GetNextEdgeInFace ( ) const
inline

Returns the next edge in face.

Definition at line 238 of file hetriang.h.

References m_nextEdgeInFace.

239  {
240  assert ( m_nextEdgeInFace );
241  return m_nextEdgeInFace;
242  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:271
const NODE_PTR& hed::EDGE::GetSourceNode ( ) const
inline

Retuns the source node.

Definition at line 245 of file hetriang.h.

References m_sourceNode.

246  {
247  return m_sourceNode;
248  }
NODE_PTR m_sourceNode
Definition: hetriang.h:269
virtual const NODE_PTR& hed::EDGE::GetTargetNode ( ) const
inlinevirtual

Returns the target node.

Definition at line 251 of file hetriang.h.

References m_nextEdgeInFace.

252  {
253  return m_nextEdgeInFace->GetSourceNode();
254  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:271
EDGE_PTR hed::EDGE::GetTwinEdge ( ) const
inline

Returns the twin edge.

Definition at line 224 of file hetriang.h.

References m_twinEdge.

225  {
226  if( m_twinEdge.expired() )
227  return nullptr;
228 
229  return m_twinEdge.lock();
230  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:270
bool hed::EDGE::IsLeadingEdge ( ) const
inline

Checks if an edge is a leading edge.

Definition at line 218 of file hetriang.h.

References m_isLeadingEdge.

219  {
220  return m_isLeadingEdge;
221  }
bool m_isLeadingEdge
Definition: hetriang.h:272
void hed::EDGE::SetAsLeadingEdge ( bool  aLeading = true)
inline

Sets the edge as a leading edge.

Definition at line 212 of file hetriang.h.

References m_isLeadingEdge.

213  {
214  m_isLeadingEdge = aLeading;
215  }
bool m_isLeadingEdge
Definition: hetriang.h:272
void hed::EDGE::SetNextEdgeInFace ( const EDGE_PTR aEdge)
inline

Sets the next edge in face.

Definition at line 200 of file hetriang.h.

References m_nextEdgeInFace.

201  {
202  m_nextEdgeInFace = aEdge;
203  }
EDGE_PTR m_nextEdgeInFace
Definition: hetriang.h:271
void hed::EDGE::SetSourceNode ( const NODE_PTR aNode)
inline

Sets the source node.

Definition at line 194 of file hetriang.h.

References m_sourceNode.

195  {
196  m_sourceNode = aNode;
197  }
NODE_PTR m_sourceNode
Definition: hetriang.h:269
void hed::EDGE::SetTwinEdge ( const EDGE_PTR aEdge)
inline

Sets the twin edge.

Definition at line 206 of file hetriang.h.

References m_twinEdge.

207  {
208  m_twinEdge = aEdge;
209  }
EDGE_WEAK_PTR m_twinEdge
Definition: hetriang.h:270

Member Data Documentation

bool hed::EDGE::m_isLeadingEdge
protected

Definition at line 272 of file hetriang.h.

Referenced by IsLeadingEdge(), and SetAsLeadingEdge().

EDGE_PTR hed::EDGE::m_nextEdgeInFace
protected

Definition at line 271 of file hetriang.h.

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

NODE_PTR hed::EDGE::m_sourceNode
protected

Definition at line 269 of file hetriang.h.

Referenced by Clear(), GetSourceNode(), and SetSourceNode().

EDGE_WEAK_PTR hed::EDGE::m_twinEdge
protected

Definition at line 270 of file hetriang.h.

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


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