KiCad PCB EDA Suite
p2t::Triangle Class Reference

#include <shapes.h>

Public Member Functions

 Triangle (Point &a, Point &b, Point &c)
 Constructor. More...
 
PointGetPoint (const int &index)
 
PointPointCW (Point &point)
 
PointPointCCW (Point &point)
 
PointOppositePoint (Triangle &t, Point &p)
 
TriangleGetNeighbor (const int &index)
 
void MarkNeighbor (Point *p1, Point *p2, Triangle *t)
 
void MarkNeighbor (Triangle &t)
 
void MarkConstrainedEdge (const int index)
 
void MarkConstrainedEdge (Edge &edge)
 
void MarkConstrainedEdge (Point *p, Point *q)
 
int Index (const Point *p)
 
int EdgeIndex (const Point *p1, const Point *p2)
 
TriangleNeighborCW (Point &point)
 
TriangleNeighborCCW (Point &point)
 
bool GetConstrainedEdgeCCW (Point &p)
 
bool GetConstrainedEdgeCW (Point &p)
 
void SetConstrainedEdgeCCW (Point &p, bool ce)
 
void SetConstrainedEdgeCW (Point &p, bool ce)
 
bool GetDelunayEdgeCCW (Point &p)
 
bool GetDelunayEdgeCW (Point &p)
 
void SetDelunayEdgeCCW (Point &p, bool e)
 
void SetDelunayEdgeCW (Point &p, bool e)
 
bool Contains (Point *p)
 
bool Contains (const Edge &e)
 
bool Contains (Point *p, Point *q)
 
void Legalize (Point &point)
 
void Legalize (Point &opoint, Point &npoint)
 
void Clear ()
 Clears all references to all other triangles and points. More...
 
void ClearNeighbor (Triangle *triangle)
 
void ClearNeighbors ()
 
void ClearDelunayEdges ()
 
bool IsInterior ()
 
void IsInterior (bool b)
 
TriangleNeighborAcross (Point &opoint)
 
void DebugPrint ()
 

Public Attributes

bool constrained_edge [3]
 Flags to determine if an edge is a Constrained edge. More...
 
bool delaunay_edge [3]
 Flags to determine if an edge is a Delauney edge. More...
 

Private Attributes

Pointpoints_ [3]
 Triangle points. More...
 
Triangleneighbors_ [3]
 Neighbor list. More...
 
bool interior_
 Has this triangle been marked as an interior triangle? More...
 

Detailed Description

Definition at line 150 of file shapes.h.

Constructor & Destructor Documentation

p2t::Triangle::Triangle ( Point a,
Point b,
Point c 
)

Constructor.

Member Function Documentation

void p2t::Triangle::Clear ( )

Clears all references to all other triangles and points.

void p2t::Triangle::ClearDelunayEdges ( )
void p2t::Triangle::ClearNeighbor ( Triangle triangle)
void p2t::Triangle::ClearNeighbors ( )
bool p2t::Triangle::Contains ( Point p)
inline

Definition at line 296 of file shapes.h.

References points_.

Referenced by Contains().

297 {
298  return p == points_[0] || p == points_[1] || p == points_[2];
299 }
Point * points_[3]
Triangle points.
Definition: shapes.h:211
bool p2t::Triangle::Contains ( const Edge e)
inline

Definition at line 301 of file shapes.h.

References Contains(), p2t::Edge::p, and p2t::Edge::q.

302 {
303  return Contains(e.p) && Contains(e.q);
304 }
bool Contains(Point *p)
Definition: shapes.h:296
bool p2t::Triangle::Contains ( Point p,
Point q 
)
inline

Definition at line 306 of file shapes.h.

References Contains().

307 {
308  return Contains(p) && Contains(q);
309 }
bool Contains(Point *p)
Definition: shapes.h:296
void p2t::Triangle::DebugPrint ( )
int p2t::Triangle::EdgeIndex ( const Point p1,
const Point p2 
)
bool p2t::Triangle::GetConstrainedEdgeCCW ( Point p)
bool p2t::Triangle::GetConstrainedEdgeCW ( Point p)
bool p2t::Triangle::GetDelunayEdgeCCW ( Point p)
bool p2t::Triangle::GetDelunayEdgeCW ( Point p)
Triangle * p2t::Triangle::GetNeighbor ( const int &  index)
inline

Definition at line 291 of file shapes.h.

References neighbors_.

292 {
293  return neighbors_[index];
294 }
Triangle * neighbors_[3]
Neighbor list.
Definition: shapes.h:213
Point * p2t::Triangle::GetPoint ( const int &  index)
inline

Definition at line 286 of file shapes.h.

References points_.

Referenced by Convert_shape_line_polygon_to_triangles().

287 {
288  return points_[index];
289 }
Point * points_[3]
Triangle points.
Definition: shapes.h:211
int p2t::Triangle::Index ( const Point p)
bool p2t::Triangle::IsInterior ( )
inline

Definition at line 311 of file shapes.h.

References interior_.

312 {
313  return interior_;
314 }
bool interior_
Has this triangle been marked as an interior triangle?
Definition: shapes.h:216
void p2t::Triangle::IsInterior ( bool  b)
inline

Definition at line 316 of file shapes.h.

References interior_.

317 {
318  interior_ = b;
319 }
bool interior_
Has this triangle been marked as an interior triangle?
Definition: shapes.h:216
void p2t::Triangle::Legalize ( Point point)
void p2t::Triangle::Legalize ( Point opoint,
Point npoint 
)
void p2t::Triangle::MarkConstrainedEdge ( const int  index)
void p2t::Triangle::MarkConstrainedEdge ( Edge edge)
void p2t::Triangle::MarkConstrainedEdge ( Point p,
Point q 
)
void p2t::Triangle::MarkNeighbor ( Point p1,
Point p2,
Triangle t 
)
void p2t::Triangle::MarkNeighbor ( Triangle t)
Triangle& p2t::Triangle::NeighborAcross ( Point opoint)
Triangle* p2t::Triangle::NeighborCCW ( Point point)
Triangle* p2t::Triangle::NeighborCW ( Point point)
Point* p2t::Triangle::OppositePoint ( Triangle t,
Point p 
)
Point* p2t::Triangle::PointCCW ( Point point)
Point* p2t::Triangle::PointCW ( Point point)
void p2t::Triangle::SetConstrainedEdgeCCW ( Point p,
bool  ce 
)
void p2t::Triangle::SetConstrainedEdgeCW ( Point p,
bool  ce 
)
void p2t::Triangle::SetDelunayEdgeCCW ( Point p,
bool  e 
)
void p2t::Triangle::SetDelunayEdgeCW ( Point p,
bool  e 
)

Member Data Documentation

bool p2t::Triangle::constrained_edge[3]

Flags to determine if an edge is a Constrained edge.

Definition at line 157 of file shapes.h.

bool p2t::Triangle::delaunay_edge[3]

Flags to determine if an edge is a Delauney edge.

Definition at line 159 of file shapes.h.

bool p2t::Triangle::interior_
private

Has this triangle been marked as an interior triangle?

Definition at line 216 of file shapes.h.

Referenced by IsInterior().

Triangle* p2t::Triangle::neighbors_[3]
private

Neighbor list.

Definition at line 213 of file shapes.h.

Referenced by GetNeighbor().

Point* p2t::Triangle::points_[3]
private

Triangle points.

Definition at line 211 of file shapes.h.

Referenced by Contains(), and GetPoint().


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