KiCad PCB EDA Suite
hed::DART Class Reference

#include <hedart.h>

Public Member Functions

 DART ()
 Default constructor. More...
 
 DART (const EDGE_PTR &aEdge, bool aDir=true)
 Constructor. More...
 
 DART (const DART &aDart)
 Copy constructor. More...
 
 ~DART ()
 Destructor. More...
 
DARToperator= (const DART &aDart)
 Assignment operator. More...
 
bool operator== (const DART &aDart) const
 Comparing dart objects. More...
 
bool operator!= (const DART &aDart) const
 Comparing dart objects. More...
 
DARTAlpha0 ()
 Maps the dart to a different node. More...
 
DARTAlpha1 ()
 Maps the dart to a different edge. More...
 
DARTAlpha2 ()
 Maps the dart to a different triangle. Note: the dart is not changed if it is at the boundary! More...
 
Utilities not required by TTL
void Init (const EDGE_PTR &aEdge, bool aDir=true)
 
double X () const
 
double Y () const
 
bool IsCCW () const
 
const NODE_PTRGetNode () const
 
const NODE_PTRGetOppositeNode () const
 
EDGE_PTRGetEdge ()
 

Private Attributes

EDGE_PTR m_edge
 
bool m_dir
 Dart direction: true if dart is counterclockwise in face. More...
 

Detailed Description

Definition at line 54 of file hedart.h.

Constructor & Destructor Documentation

hed::DART::DART ( )
inline

Default constructor.

Definition at line 63 of file hedart.h.

64  {
65  m_dir = true;
66  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
hed::DART::DART ( const EDGE_PTR aEdge,
bool  aDir = true 
)
inline

Constructor.

Definition at line 69 of file hedart.h.

70  {
71  m_edge = aEdge;
72  m_dir = aDir;
73  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
hed::DART::DART ( const DART aDart)
inline

Copy constructor.

Definition at line 76 of file hedart.h.

References m_dir, and m_edge.

77  {
78  m_edge = aDart.m_edge;
79  m_dir = aDart.m_dir;
80  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
hed::DART::~DART ( )
inline

Destructor.

Definition at line 83 of file hedart.h.

84  {
85  }

Member Function Documentation

DART& hed::DART::Alpha0 ( )
inline

Maps the dart to a different node.

Definition at line 112 of file hedart.h.

References m_dir.

Referenced by hed::TTLtraits::CrossProduct2D(), and hed::TTLtraits::ScalarProduct2D().

113  {
114  m_dir = !m_dir;
115  return *this;
116  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
DART& hed::DART::Alpha1 ( )
inline

Maps the dart to a different edge.

Definition at line 119 of file hedart.h.

120  {
121  if( m_dir )
122  {
123  m_edge = m_edge->GetNextEdgeInFace()->GetNextEdgeInFace();
124  m_dir = false;
125  }
126  else
127  {
128  m_edge = m_edge->GetNextEdgeInFace();
129  m_dir = true;
130  }
131 
132  return *this;
133  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
DART& hed::DART::Alpha2 ( )
inline

Maps the dart to a different triangle. Note: the dart is not changed if it is at the boundary!

Definition at line 136 of file hedart.h.

References m_dir.

137  {
138  if( m_edge->GetTwinEdge() )
139  {
140  m_edge = m_edge->GetTwinEdge();
141  m_dir = !m_dir;
142  }
143 
144  // else, the dart is at the boundary and should not be changed
145  return *this;
146  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
EDGE_PTR& hed::DART::GetEdge ( )
inline
const NODE_PTR& hed::DART::GetNode ( ) const
inline

Definition at line 171 of file hedart.h.

Referenced by X(), and Y().

172  {
173  return m_dir ? m_edge->GetSourceNode() : m_edge->GetTargetNode();
174  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
const NODE_PTR& hed::DART::GetOppositeNode ( ) const
inline

Definition at line 176 of file hedart.h.

177  {
178  return m_dir ? m_edge->GetTargetNode() : m_edge->GetSourceNode();
179  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
void hed::DART::Init ( const EDGE_PTR aEdge,
bool  aDir = true 
)
inline

Definition at line 150 of file hedart.h.

Referenced by hed::TRIANGULATION::splitTriangle().

151  {
152  m_edge = aEdge;
153  m_dir = aDir;
154  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
bool hed::DART::IsCCW ( ) const
inline

Definition at line 166 of file hedart.h.

References m_dir.

167  {
168  return m_dir;
169  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
bool hed::DART::operator!= ( const DART aDart) const
inline

Comparing dart objects.

Definition at line 106 of file hedart.h.

107  {
108  return !( aDart == *this );
109  }
DART& hed::DART::operator= ( const DART aDart)
inline

Assignment operator.

Definition at line 88 of file hedart.h.

References m_dir, and m_edge.

89  {
90  if( this == &aDart )
91  return *this;
92 
93  m_edge = aDart.m_edge;
94  m_dir = aDart.m_dir;
95 
96  return *this;
97  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
bool hed::DART::operator== ( const DART aDart) const
inline

Comparing dart objects.

Definition at line 100 of file hedart.h.

References m_dir, and m_edge.

101  {
102  return ( aDart.m_edge == m_edge && aDart.m_dir == m_dir );
103  }
bool m_dir
Dart direction: true if dart is counterclockwise in face.
Definition: hedart.h:59
EDGE_PTR m_edge
Definition: hedart.h:56
double hed::DART::X ( ) const
inline

Definition at line 156 of file hedart.h.

References GetNode().

Referenced by hed::TTLtraits::CrossProduct2D(), hed::TTLtraits::Orient2D(), and hed::TTLtraits::ScalarProduct2D().

157  {
158  return GetNode()->GetX();
159  }
const NODE_PTR & GetNode() const
Definition: hedart.h:171
double hed::DART::Y ( ) const
inline

Definition at line 161 of file hedart.h.

References GetNode().

Referenced by hed::TTLtraits::CrossProduct2D(), hed::TTLtraits::Orient2D(), and hed::TTLtraits::ScalarProduct2D().

162  {
163  return GetNode()->GetY();
164  }
const NODE_PTR & GetNode() const
Definition: hedart.h:171

Member Data Documentation

bool hed::DART::m_dir
private

Dart direction: true if dart is counterclockwise in face.

Definition at line 59 of file hedart.h.

Referenced by Alpha0(), Alpha2(), DART(), IsCCW(), operator=(), and operator==().

EDGE_PTR hed::DART::m_edge
private

Definition at line 56 of file hedart.h.

Referenced by DART(), GetEdge(), operator=(), and operator==().


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