LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
rcsc::DelaunayTriangulation::Triangle Class Reference

triangle data More...

#include <delaunay_triangulation.h>

Public Member Functions

 Triangle (const int id, EdgePtr e0, EdgePtr e1, EdgePtr e2)
 create triangle with index and edges More...
 
 ~Triangle ()
 remove this triangle from all edges.
 
void updateVoronoiVertex ()
 update the voronoi vertex point (intersection of perpendicular bisectors)
 
int id () const
 get the Id of this triangle More...
 
const Vertexvertex (std::size_t i) const
 get the raw pointer to the vertex that this triangle has More...
 
Edgeedge (std::size_t i) const
 get the raw pointer to the edge that this triangle has More...
 
const Vector2Dcircumcenter () const
 get the circumcenter point of this triangle More...
 
double circumradius () const
 get the radius of the circumcircle of this triangle More...
 
const Vector2DvoronoiVertex () const
 get the voronoi vertex point More...
 
bool contains (const Vector2D &pos) const
 check if circumcircle contains the specified point More...
 
bool hasVertex (const Vertex *v) const
 check if this triangle has the specified vertex. More...
 
bool hasEdge (const EdgePtr e) const
 check if this triangle has the specified edge. More...
 
const VertexgetVertexExclude (const Vertex *v1, const Vertex *v2) const
 get the pointer to the vertex that is different from the specified vertices. More...
 
const VertexgetVertexExclude (const Edge *edge) const
 get the pointer to the vertex that does not belong to the specified edge. More...
 
EdgegetEdgeInclude (const Vertex *v1, const Vertex *v2) const
 get the pointer to the edge that has the specified vertices. More...
 
EdgegetEdgeExclude (const Vertex *v) const
 get the pointer to the edge that does not have the specified vertex. More...
 

Detailed Description

triangle data

Constructor & Destructor Documentation

◆ Triangle()

rcsc::DelaunayTriangulation::Triangle::Triangle ( const int  id,
EdgePtr  e0,
EdgePtr  e1,
EdgePtr  e2 
)

create triangle with index and edges

Parameters
idId number of this triangle
e0raw pointer to the first edge instance
e1raw pointer to the second edge instance
e2raw pointer to the third edge instance

pointers to the vertices are automatically set from edges.

Member Function Documentation

◆ circumcenter()

const Vector2D & rcsc::DelaunayTriangulation::Triangle::circumcenter ( ) const
inline

get the circumcenter point of this triangle

Returns
coordinates of the circumcenter

◆ circumradius()

double rcsc::DelaunayTriangulation::Triangle::circumradius ( ) const
inline

get the radius of the circumcircle of this triangle

Returns
radius value

◆ contains()

bool rcsc::DelaunayTriangulation::Triangle::contains ( const Vector2D pos) const
inline

check if circumcircle contains the specified point

Parameters
postarget point
Returns
true if target point is contained

◆ edge()

Edge * rcsc::DelaunayTriangulation::Triangle::edge ( std::size_t  i) const
inline

get the raw pointer to the edge that this triangle has

Parameters
ispecifies array index
Returns
raw pointer to the edge

◆ getEdgeExclude()

Edge * rcsc::DelaunayTriangulation::Triangle::getEdgeExclude ( const Vertex v) const
inline

get the pointer to the edge that does not have the specified vertex.

Parameters
vtarget vertex
Returns
if exist, raw pointer to the edge, else NULL is returned.

◆ getEdgeInclude()

Edge * rcsc::DelaunayTriangulation::Triangle::getEdgeInclude ( const Vertex v1,
const Vertex v2 
) const
inline

get the pointer to the edge that has the specified vertices.

Parameters
v1first vertex
v2second vertex
Returns
if exist, raw pointer to the edge, else NULL is returned.

◆ getVertexExclude() [1/2]

const Vertex * rcsc::DelaunayTriangulation::Triangle::getVertexExclude ( const Edge edge) const
inline

get the pointer to the vertex that does not belong to the specified edge.

Parameters
edgetarget edge
Returns
if exist, const pointer to the vertex, else NULL is returned.

◆ getVertexExclude() [2/2]

const Vertex * rcsc::DelaunayTriangulation::Triangle::getVertexExclude ( const Vertex v1,
const Vertex v2 
) const
inline

get the pointer to the vertex that is different from the specified vertices.

Parameters
v1first vertex
v2second vertex
Returns
if exist, const pointer to the vertex. else NULL is returned.

◆ hasEdge()

bool rcsc::DelaunayTriangulation::Triangle::hasEdge ( const EdgePtr  e) const
inline

check if this triangle has the specified edge.

Parameters
eraw pointer to the edge.
Returns
true if edge is contained.

◆ hasVertex()

bool rcsc::DelaunayTriangulation::Triangle::hasVertex ( const Vertex v) const
inline

check if this triangle has the specified vertex.

Parameters
vraw pointer to the vertex.
Returns
true if vertex is contained.

◆ id()

int rcsc::DelaunayTriangulation::Triangle::id ( ) const
inline

get the Id of this triangle

Returns
Id number

◆ vertex()

const Vertex * rcsc::DelaunayTriangulation::Triangle::vertex ( std::size_t  i) const
inline

get the raw pointer to the vertex that this triangle has

Parameters
ispecifies array index
Returns
const pointer to the vertex

◆ voronoiVertex()

const Vector2D & rcsc::DelaunayTriangulation::Triangle::voronoiVertex ( ) const
inline

get the voronoi vertex point

Returns
coordinate of the voronoi vertex point. if illegal data, invalid vector is returned.

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