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 125 of file shapes.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 130 of file shapes.h.

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

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

Member Data Documentation

Point* p2t::Edge::p

Definition at line 127 of file shapes.h.

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

Point * p2t::Edge::q

Definition at line 127 of file shapes.h.

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


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