NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Simple mesh implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. This stores a list of vertices and another list of triangles (which references the vertex list) More...
Public Member Functions | |
BasicMesh () | |
Default constructor. More... | |
BasicMesh (std::vector< BasicVertex > &vertices, std::vector< BasicTriangle > &triangles, int numOfVerts, int numOfTris) | |
Constructor with vertices and triangles as parameters. More... | |
virtual | ~BasicMesh () |
Destructor. More... | |
void | InitWithVertsAndTris (std::vector< BasicVertex > &vertices, std::vector< BasicTriangle > &triangles, int numOfVerts, int numOfTris) |
Initialize the mesh with an externally defined set of triangles and vertices. More... | |
BasicMesh (const BasicMesh &) | |
Copy constructor. More... | |
BasicMesh & | operator= (const BasicMesh &) |
Assignment operator. More... | |
BasicVertex & | GetVertex (int index) |
Get reference to the vertex with the specified index. More... | |
const BasicVertex & | GetVertex (int index) const |
Get const reference to the vertex with the specified index. More... | |
BasicTriangle & | GetTri (int index) |
Get reference to the triangle with the specified index. More... | |
const BasicTriangle & | GetTri (int index) const |
Get const reference to the triangle with the specified index. More... | |
int | GetNumVerts () |
Get number of vertices. More... | |
void | SetNumVerts (int n) |
Set number of vertices. More... | |
int | GetNumTriangles () |
Get number of triangles. More... | |
void | SetNumTriangles (int n) |
Set number of triangles. More... | |
void | Normalize () |
Normalize the mesh: center the mesh around the origin and shrink to fit in [-1, 1]. More... | |
void | CalcOneVertNormal (unsigned vert) |
Compute normal for the vertex with the specified index. More... | |
void | PrintStatus () |
Print mesh state to std::cout. More... | |
Simple mesh implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. This stores a list of vertices and another list of triangles (which references the vertex list)
niftk::BasicMesh::BasicMesh | ( | ) |
Default constructor.
niftk::BasicMesh::BasicMesh | ( | std::vector< BasicVertex > & | vertices, |
std::vector< BasicTriangle > & | triangles, | ||
int | numOfVerts, | ||
int | numOfTris | ||
) |
Constructor with vertices and triangles as parameters.
|
virtual |
Destructor.
niftk::BasicMesh::BasicMesh | ( | const BasicMesh & | other | ) |
Copy constructor.
void niftk::BasicMesh::CalcOneVertNormal | ( | unsigned | vert | ) |
Compute normal for the vertex with the specified index.
|
inline |
Get number of triangles.
|
inline |
Get number of vertices.
|
inline |
Get reference to the triangle with the specified index.
|
inline |
Get const reference to the triangle with the specified index.
|
inline |
Get reference to the vertex with the specified index.
|
inline |
Get const reference to the vertex with the specified index.
void niftk::BasicMesh::InitWithVertsAndTris | ( | std::vector< BasicVertex > & | vertices, |
std::vector< BasicTriangle > & | triangles, | ||
int | numOfVerts, | ||
int | numOfTris | ||
) |
Initialize the mesh with an externally defined set of triangles and vertices.
void niftk::BasicMesh::Normalize | ( | ) |
Normalize the mesh: center the mesh around the origin and shrink to fit in [-1, 1].
void niftk::BasicMesh::PrintStatus | ( | ) |
Print mesh state to std::cout.