OGS
|
Class Triangle consists of a reference to a point vector and a vector that stores the indices in the point vector. A surface is composed by triangles. The class Surface stores the position of pointers to the points of triangles in the _pnt_ids vector.
Definition at line 26 of file Triangle.h.
#include <Triangle.h>
Public Member Functions | |
Triangle (std::vector< Point * > const &pnt_vec, std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_c) | |
const std::size_t & | operator[] (std::size_t i) const |
const access operator to access the index of the i-th triangle point | |
const Point * | getPoint (std::size_t i) const |
const access operator to access the i-th triangle Point | |
bool | containsPoint (MathLib::Point3d const &q, double eps=std::numeric_limits< float >::epsilon()) const |
Private Attributes | |
std::vector< Point * > const & | _pnts |
a vector of pointers to points the triangle is based on | |
std::array< std::size_t, 3 > | _pnt_ids |
position of pointers to the geometric points | |
GeoLib::Triangle::Triangle | ( | std::vector< Point * > const & | pnt_vec, |
std::size_t | pnt_a, | ||
std::size_t | pnt_b, | ||
std::size_t | pnt_c ) |
construction of object, initialization of reference to point vector, saves the three indices describing a triangle
Definition at line 20 of file Triangle.cpp.
bool GeoLib::Triangle::containsPoint | ( | MathLib::Point3d const & | q, |
double | eps = std::numeric_limits<float>::epsilon() ) const |
Checks if point q is within the triangle, uses GeoLib::isPointInTriangle().
q | The input point. |
eps | Checks the 'epsilon'-neighbourhood |
Definition at line 29 of file Triangle.cpp.
References _pnt_ids, _pnts, and MathLib::isPointInTriangle().
|
inline |
const access operator to access the i-th triangle Point
Definition at line 50 of file Triangle.h.
References _pnt_ids, and _pnts.
Referenced by GeoLib::DuplicateGeometry::copySurfacesVector(), GeoLib::SurfaceGrid::sortTriangleInGridCells(), and GeoLib::IO::TINInterface::writeSurfaceAsTIN().
|
inline |
const access operator to access the index of the i-th triangle point
Definition at line 41 of file Triangle.h.
References _pnt_ids.
|
private |
position of pointers to the geometric points
Definition at line 71 of file Triangle.h.
Referenced by containsPoint(), getPoint(), and operator[]().
|
private |
a vector of pointers to points the triangle is based on
Definition at line 69 of file Triangle.h.
Referenced by containsPoint(), and getPoint().