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

References points_.

Referenced by Contains().

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

Definition at line 327 of file shapes.h.

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

328 {
329  return Contains( e.p ) && Contains( e.q );
330 }
bool Contains(Point *p)
Definition: shapes.h:321
bool p2t::Triangle::Contains ( Point p,
Point q 
)
inline

Definition at line 333 of file shapes.h.

References Contains().

334 {
335  return Contains( p ) && Contains( q );
336 }
bool Contains(Point *p)
Definition: shapes.h:321
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 315 of file shapes.h.

References neighbors_.

316 {
317  return neighbors_[index];
318 }
Triangle * neighbors_[3]
Neighbor list.
Definition: shapes.h:221
Point * p2t::Triangle::GetPoint ( const int &  index)
inline

Definition at line 309 of file shapes.h.

References points_.

Referenced by Convert_shape_line_polygon_to_triangles().

310 {
311  return points_[index];
312 }
Point * points_[3]
Triangle points.
Definition: shapes.h:219
int p2t::Triangle::Index ( const Point p)
bool p2t::Triangle::IsInterior ( )
inline

Definition at line 339 of file shapes.h.

References interior_.

340 {
341  return interior_;
342 }
bool interior_
Has this triangle been marked as an interior triangle?
Definition: shapes.h:224
void p2t::Triangle::IsInterior ( bool  b)
inline

Definition at line 345 of file shapes.h.

References interior_.

346 {
347  interior_ = b;
348 }
bool interior_
Has this triangle been marked as an interior triangle?
Definition: shapes.h:224
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 164 of file shapes.h.

bool p2t::Triangle::delaunay_edge[3]

Flags to determine if an edge is a Delauney edge.

Definition at line 166 of file shapes.h.

bool p2t::Triangle::interior_
private

Has this triangle been marked as an interior triangle?

Definition at line 224 of file shapes.h.

Referenced by IsInterior().

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

Neighbor list.

Definition at line 221 of file shapes.h.

Referenced by GetNeighbor().

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

Triangle points.

Definition at line 219 of file shapes.h.

Referenced by Contains(), and GetPoint().


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