KiCad PCB EDA Suite
hed::NODE Class Reference

Node class for data structures (Inherits from HandleId) More...

#include <hetriang.h>

Public Member Functions

 NODE (int aX=0, int aY=0, std::shared_ptr< CN_CLUSTER > aCluster=nullptr)
 Constructor. More...
 
 ~NODE ()
 Destructor. More...
 
const VECTOR2D Pos () const
 
int GetX () const
 Returns the x-coordinate. More...
 
int GetY () const
 Returns the y-coordinate. More...
 
VECTOR2I GetPos () const
 
void SetId (int aId)
 Returns the id (TTL_USE_NODE_ID must be defined) More...
 
int Id () const
 
void SetFlag (bool aFlag)
 Sets the flag (TTL_USE_NODE_FLAG must be defined) More...
 
const bool & GetFlag () const
 Returns the flag (TTL_USE_NODE_FLAG must be defined) More...
 

Protected Attributes

bool m_flag
 TTL_USE_NODE_FLAG must be defined. More...
 
int m_id
 A unique id for each node (TTL_USE_NODE_ID must be defined) More...
 
const int m_x
 Node coordinates. More...
 
const int m_y
 

Static Protected Attributes

static int id_count = 0
 TTL_USE_NODE_ID must be defined. More...
 

Detailed Description

Node class for data structures (Inherits from HandleId)

Note
  • To enable node IDs, TTL_USE_NODE_ID must be defined.
  • To enable node flags, TTL_USE_NODE_FLAG must be defined.
  • TTL_USE_NODE_ID and TTL_USE_NODE_FLAG should only be enabled if this functionality is required by the application, because they increase the memory usage for each Node object.

Definition at line 89 of file hetriang.h.

Constructor & Destructor Documentation

hed::NODE::NODE ( int  aX = 0,
int  aY = 0,
std::shared_ptr< CN_CLUSTER aCluster = nullptr 
)
inline

Constructor.

Definition at line 110 of file hetriang.h.

110  :
111 #ifdef TTL_USE_NODE_FLAG
112  m_flag( false ),
113 #endif
114 #ifdef TTL_USE_NODE_ID
115  m_id( id_count++ ),
116 #endif
117  m_x( aX ), m_y( aY )
118  {
119  }
static int id_count
TTL_USE_NODE_ID must be defined.
Definition: hetriang.h:99
bool m_flag
TTL_USE_NODE_FLAG must be defined.
Definition: hetriang.h:94
int m_id
A unique id for each node (TTL_USE_NODE_ID must be defined)
Definition: hetriang.h:102
const int m_y
Definition: hetriang.h:106
const int m_x
Node coordinates.
Definition: hetriang.h:106
hed::NODE::~NODE ( )
inline

Destructor.

Definition at line 122 of file hetriang.h.

122  {
123 
124  }

Member Function Documentation

const bool& hed::NODE::GetFlag ( ) const
inline

Returns the flag (TTL_USE_NODE_FLAG must be defined)

Definition at line 167 of file hetriang.h.

References m_flag.

168  {
169  return m_flag;
170  }
bool m_flag
TTL_USE_NODE_FLAG must be defined.
Definition: hetriang.h:94
VECTOR2I hed::NODE::GetPos ( ) const
inline

Definition at line 140 of file hetriang.h.

141  {
142  return VECTOR2I( m_x, m_y );
143  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:590
const int m_y
Definition: hetriang.h:106
const int m_x
Node coordinates.
Definition: hetriang.h:106
int hed::NODE::GetX ( ) const
inline

Returns the x-coordinate.

Definition at line 129 of file hetriang.h.

References m_x.

130  {
131  return m_x;
132  }
const int m_x
Node coordinates.
Definition: hetriang.h:106
int hed::NODE::GetY ( ) const
inline

Returns the y-coordinate.

Definition at line 135 of file hetriang.h.

References m_y.

136  {
137  return m_y;
138  }
const int m_y
Definition: hetriang.h:106
int hed::NODE::Id ( ) const
inline

Definition at line 153 of file hetriang.h.

References m_id.

154  {
155  return m_id;
156  }
int m_id
A unique id for each node (TTL_USE_NODE_ID must be defined)
Definition: hetriang.h:102
const VECTOR2D hed::NODE::Pos ( ) const
inline

Definition at line 126 of file hetriang.h.

126 { return VECTOR2D( m_x, m_y ); }
VECTOR2< double > VECTOR2D
Definition: vector2d.h:589
const int m_y
Definition: hetriang.h:106
const int m_x
Node coordinates.
Definition: hetriang.h:106
void hed::NODE::SetFlag ( bool  aFlag)
inline

Sets the flag (TTL_USE_NODE_FLAG must be defined)

Definition at line 161 of file hetriang.h.

162  {
163  m_flag = aFlag;
164  }
bool m_flag
TTL_USE_NODE_FLAG must be defined.
Definition: hetriang.h:94
void hed::NODE::SetId ( int  aId)
inline

Returns the id (TTL_USE_NODE_ID must be defined)

Definition at line 148 of file hetriang.h.

149  {
150  m_id = aId;
151  }
int m_id
A unique id for each node (TTL_USE_NODE_ID must be defined)
Definition: hetriang.h:102

Member Data Documentation

int NODE::id_count = 0
staticprotected

TTL_USE_NODE_ID must be defined.

Definition at line 99 of file hetriang.h.

bool hed::NODE::m_flag
protected

TTL_USE_NODE_FLAG must be defined.

Definition at line 94 of file hetriang.h.

Referenced by GetFlag().

int hed::NODE::m_id
protected

A unique id for each node (TTL_USE_NODE_ID must be defined)

Definition at line 102 of file hetriang.h.

Referenced by Id().

const int hed::NODE::m_x
protected

Node coordinates.

Definition at line 106 of file hetriang.h.

Referenced by GetX().

const int hed::NODE::m_y
protected

Definition at line 106 of file hetriang.h.

Referenced by GetY().


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