|
DelaunayTriangulation
A C++ Object Oriented data structure with algorithms that could be used to generate a Delaunay triangulation
|
Parent class of all objects, contains full triangulation and its constituent parts. More...
#include <Mesh.hpp>


Public Member Functions | |
| Mesh () | |
| Default contructor. | |
| ~Mesh () | |
| Default destructor. | |
| std::vector< Vec > | resolvePoints (std::vector< vertInd > vertInds) |
| Implementation of IMesh::resolvePoints Resolves vector of vertex indices to vector of vertex pointers. | |
| bool | isDelaunay () |
| Checks whether mesh is Delauney. | |
| std::vector< edge > | newEdges (triInd triInd, const std::vector< vertInd > &vert) |
| Implementation of IMesh::newEdges Adds triangle's new edges to map. | |
| void | removeEdges (triInd triInd, const std::vector< edge > &rEdge) |
| Implementation of IMesh::removeEdges Remove triangle's old edges from map. | |
| int | containingTriangle (double x, double y) |
| Find the triangle which contains the point \((x,y)\). | |
| std::vector< int > | adjacentTriangles (triInd triInd) |
| Find all triangles that share an edge with triangle represented by triInd. | |
| void | recalcCircum (vertInd vertInd) |
| Implementation of IMesh::recalcCircum Recalculate the Triangle::circumcircle of all Triangles using vertex represented by vertInd. | |
| void | updateVertTri (triInd triInd, std::vector< vertInd > vertInds) |
| Implementation of IMesh::updateVertTri Add Triangle represented by triInd to vertTri. | |
| void | removeVertTri (triInd triInd, std::vector< vertInd > rVertInds) |
| Implementation of IMesh::removeVertTri Remove triangle index from vertTri. | |
| template<typename T> | |
| double | integrate (T func, double(*interp)(T, const Triangle &)) |
| Estimate the integral of the function func over the mesh. | |
| const std::map< int, Vertex > & | getVertices () const |
| Accessor to private member vertices. | |
| void | setVertices (const std::map< int, Vertex > &vertices) |
| Mutator for private member vertices. | |
| const std::map< int, Triangle > & | getTriangles () const |
| Accessor to private member vertices. | |
| void | setTriangles (const std::map< int, Triangle > &triangles) |
| Mutator for private member triangles. | |
| int | getVertexAttributes () const |
| Accessor for private member vertexAttributes. | |
| void | setVertexAttributes (int verAttr) |
| Mutator for private member vertexAttributes. | |
| int | getTriangleAttributes () const |
| Accessor for private member triangleAttributes. | |
| void | setTriangleAttributes (int triAttr) |
| Mutator for private member triangleAttributes. | |
| int | getDimensions () const |
| Accessor for private member dimensions. | |
| const std::map< std::pair< int, int >, std::vector< int > > & | getEdges () const |
| Accessor for private member edges. | |
| bool | operator== (const Mesh &rhs) const |
| Equality operator. | |
| bool | operator!= (const Mesh &rhs) const |
| Not-equality operator. | |
Public Member Functions inherited from IMesh | |
| virtual | ~IMesh () |
| Virtual destructor. | |
Private Attributes | |
| int | vertexAttributes |
| Number of attributes in a vertex object. | |
| int | triangleAttributes |
| Number of attributes in a triangle object. | |
| int | dimensions |
| Number of dimensions of the mesh. | |
| std::map< triInd, Triangle > | triangles |
| Map of triangle indices to triangles they refer to. | |
| std::map< vertInd, Vertex > | vertices |
| Map of vertex indices to vertices they refer to. | |
| std::map< edge, std::vector< triInd > > | edges |
| Map of pairs of vertex indices (representing an edge) to a vector of triangles using them. | |
| std::map< vertInd, std::vector< triInd > > | vertTri |
| Map of a vertex index to a vector of triangles using them. | |
Friends | |
| std::ifstream & | operator>> (std::ifstream &ifs, Mesh &mesh) |
| Input filestream operator. | |
| std::ofstream & | operator<< (std::ofstream &ofs, Mesh &mesh) |
| Output filestream operator. | |
Additional Inherited Members | |
Public Types inherited from IMesh | |
| typedef std::pair< int, int > | edge |
| Type representing an edge, two vertex indices. | |
| typedef int | vertInd |
| Type representing an index of a vertex. | |
| typedef int | triInd |
| Type representing an index of a triangle. | |
Parent class of all objects, contains full triangulation and its constituent parts.
| std::vector< int > Mesh::adjacentTriangles | ( | triInd | triInd | ) |
| int Mesh::containingTriangle | ( | double | x, |
| double | y ) |
Find the triangle which contains the point \((x,y)\).
| x | |
| y |
| int Mesh::getDimensions | ( | ) | const |
Accessor for private member dimensions.
| const std::map< Mesh::edge, std::vector< int > > & Mesh::getEdges | ( | ) | const |
Accessor for private member edges.
| int Mesh::getTriangleAttributes | ( | ) | const |
Accessor for private member triangleAttributes.
| const std::map< int, Triangle > & Mesh::getTriangles | ( | ) | const |
| int Mesh::getVertexAttributes | ( | ) | const |
Accessor for private member vertexAttributes.
| const std::map< int, Vertex > & Mesh::getVertices | ( | ) | const |
|
inline |
Estimate the integral of the function func over the mesh.
| T | function with signature double (double, double) |
| func | Mathematical function to be integrated |
| interp | Function with signature double(T, const Triangle&) which will integrate the function over a triangle Examples are Utils::constantValueApprox and Utils::linearInterpolationApprox |
| bool Mesh::isDelaunay | ( | ) |
Checks whether mesh is Delauney.
| std::runtime_error | if mesh has no triangles |
|
virtual |
Implementation of IMesh::newEdges Adds triangle's new edges to map.
| triInd | index of the triangle using the vertices |
| vert | Vector of vertex indices being used by the triangle |
Implements IMesh.
| bool Mesh::operator!= | ( | const Mesh & | rhs | ) | const |
Not-equality operator.
| rhs |
| bool Mesh::operator== | ( | const Mesh & | rhs | ) | const |
Equality operator.
| rhs |
|
virtual |
Implementation of IMesh::recalcCircum Recalculate the Triangle::circumcircle of all Triangles using vertex represented by vertInd.
| vertInd | Index of changed Vector |
Implements IMesh.
Implementation of IMesh::removeEdges Remove triangle's old edges from map.
| triInd | index of triangle using the vertices |
| rEdge | Vector of edges that are no longer in use by the triangle |
Implements IMesh.
Implementation of IMesh::removeVertTri Remove triangle index from vertTri.
Implements IMesh.
Implementation of IMesh::resolvePoints Resolves vector of vertex indices to vector of vertex pointers.
| vertInds | Vector of indices of vertexes |
| std::runtime_error | if index is out of range of valid vertices |
Implements IMesh.
| void Mesh::setTriangleAttributes | ( | int | triAttr | ) |
Mutator for private member triangleAttributes.
| triAttr | number of Triangle attributes |
| void Mesh::setTriangles | ( | const std::map< int, Triangle > & | triangles | ) |
| void Mesh::setVertexAttributes | ( | int | verAttr | ) |
Mutator for private member vertexAttributes.
| verAttr | number of Vertex attributes |
| void Mesh::setVertices | ( | const std::map< int, Vertex > & | vertices | ) |
Implementation of IMesh::updateVertTri Add Triangle represented by triInd to vertTri.
Implements IMesh.
|
friend |
Output filestream operator.
| ofs | |
| mesh |
|
friend |
Input filestream operator.
| ifs | |
| mesh |
Map of pairs of vertex indices (representing an edge) to a vector of triangles using them.
Map of a vertex index to a vector of triangles using them.