GEOS  3.10.3
Public Member Functions | Static Public Member Functions | Friends | List of all members
geos::triangulate::tri::Tri Class Reference

#include <Tri.h>

Public Member Functions

 Tri (const Coordinate &c0, const Coordinate &c1, const Coordinate &c2)
 
void setAdjacent (Tri *p_tri0, Tri *p_tri1, Tri *p_tri2)
 
void setTri (TriIndex edgeIndex, Tri *tri)
 
void setAdjacent (const Coordinate &pt, Tri *tri)
 
void flip (TriIndex index)
 
void validate ()
 
void validateAdjacent (TriIndex index)
 
std::pair< const Coordinate &, const Coordinate & > getEdge (Tri *neighbor) const
 
const CoordinategetEdgeStart (TriIndex i) const
 
const CoordinategetEdgeEnd (TriIndex i) const
 
bool hasCoordinate (const Coordinate &v) const
 
const CoordinategetCoordinate (TriIndex i) const
 
TriIndex getIndex (const Coordinate &p) const
 
TriIndex getIndex (Tri *tri) const
 
TrigetAdjacent (TriIndex i) const
 
bool hasAdjacent (TriIndex i) const
 
bool isAdjacent (Tri *tri) const
 
int numAdjacent () const
 
Coordinate midpoint (TriIndex edgeIndex) const
 
std::unique_ptr< PolygontoPolygon (const GeometryFactory *gf) const
 

Static Public Member Functions

static TriIndex next (TriIndex i)
 
static TriIndex prev (TriIndex i)
 
static TriIndex oppVertex (TriIndex edgeIndex)
 
static TriIndex oppEdge (TriIndex vertexIndex)
 

Friends

std::ostream & operator<< (std::ostream &os, const Tri &)
 

Detailed Description

A memory-efficient representation of a triangle in a triangulation. Contains three vertices, and links to adjacent Tris for each edge. Tris are constructed independently, and if needed linked into a triangulation using TriangulationBuilder.

Author
mdavis

Member Function Documentation

◆ flip()

void geos::triangulate::tri::Tri::flip ( TriIndex  index)

Interchanges the vertices of this triangle and a neighbor so that their common edge becomes the the other diagonal of the quadrilateral they form. Neighbour triangle links are modified accordingly.

Parameters
indexthe index of the adjacent tri to flip with

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