Class Triangle

Class Documentation

class Triangle

Represents a triangle, includes all elements to ease the Delaunay triangulation calculation.

Public Functions

Triangle(const cNode &n0, const cNode &n1, const cNode &n2)

Construct a new Triangle object from 3 cNode(s).

Parameters:
  • n0[in]

  • n1[in]

  • n2[in]

Triangle(const Edge &e, const cNode &n)

Construct a new Triangle object from an Edge and a Node.

Parameters:
  • e[in]

  • n[in]

bool operator==(const Triangle &t) const

Comparison operator, two triangles will be equal if they have the same hash.

Parameters:

t[in]

bool operator!=(const Triangle &t) const

Negation of the comparison operator.

Parameters:

t[in]

bool containsNode(const cNode &n) const

Checks if the Triangle contains the Node n.

Parameters:

n[in]

bool containsEdge(const Edge &e) const

Checks if the Edge e belongs to the Triangle.

Parameters:

e[in]

bool circleContainsNode(const cNode &n) const

Checks if a Node is inside the Triangle’s circumcircle.

Parameters:

n[in]

bool anyNodeInSuperTriangle() const

Checks if any Node of the Triangle belongs to the supertriangle.

std::array<double, 3> angles() const

Returns an array with the 3 angles of the Triangle.

const Point &circumCenter() const

Returns the circumcenter in local coordinates.

const Point &circumCenterGlobal() const

Returns the circumcenter in global coordinates.

Public Members

const std::array<cNode, 3> nodes

The 3 cNode(s) defining a Triangle.

const std::array<Edge, 3> edges

The Edge(s) defined by the 3 Node(s). This object contains basically same info as nodes, but it facilitates accessing the Triangles’ edges and makes the program a bit quicker spending little extra memory.

Friends

friend class std::hash< Triangle >
friend std::ostream &operator<<(std::ostream &os, const Triangle &t)

Cout operator.

Parameters:
  • os[inout]

  • t[in]