KiCad PCB EDA Suite
p2t::Edge Struct Reference

#include <shapes.h>

Public Member Functions

 Edge (Point &p1, Point &p2)
 Constructor. More...
 

Public Attributes

Pointp
 
Pointq
 

Detailed Description

Definition at line 123 of file shapes.h.

Constructor & Destructor Documentation

p2t::Edge::Edge ( Point p1,
Point p2 
)
inline

Constructor.

Definition at line 128 of file shapes.h.

References p2t::Point::edge_list, p2t::Point::x, and p2t::Point::y.

128  : p( &p1 ), q( &p2 )
129  {
130  if( p1.y > p2.y )
131  {
132  q = &p1;
133  p = &p2;
134  }
135  else if( p1.y == p2.y )
136  {
137  if( p1.x > p2.x )
138  {
139  q = &p1;
140  p = &p2;
141  }
142  else if( p1.x == p2.x )
143  {
144  // Repeat points
145  assert( false );
146  }
147  }
148 
149  q->edge_list.push_back( this );
150  }
Point * q
Definition: shapes.h:125
Point * p
Definition: shapes.h:125
std::vector< Edge * > edge_list
The edges this point constitutes an upper ending point.
Definition: shapes.h:56

Member Data Documentation

Point* p2t::Edge::p

Definition at line 125 of file shapes.h.

Referenced by p2t::Triangle::Contains().

Point * p2t::Edge::q

Definition at line 125 of file shapes.h.

Referenced by p2t::Triangle::Contains().


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