NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | List of all members
niftk::BasicMesh Class Reference

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...
 
BasicMeshoperator= (const BasicMesh &)
 Assignment operator. More...
 
BasicVertexGetVertex (int index)
 Get reference to the vertex with the specified index. More...
 
const BasicVertexGetVertex (int index) const
 Get const reference to the vertex with the specified index. More...
 
BasicTriangleGetTri (int index)
 Get reference to the triangle with the specified index. More...
 
const BasicTriangleGetTri (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...
 

Detailed Description

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)

Constructor & Destructor Documentation

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.

niftk::BasicMesh::~BasicMesh ( )
virtual

Destructor.

niftk::BasicMesh::BasicMesh ( const BasicMesh other)

Copy constructor.

Member Function Documentation

void niftk::BasicMesh::CalcOneVertNormal ( unsigned  vert)

Compute normal for the vertex with the specified index.

int niftk::BasicMesh::GetNumTriangles ( )
inline

Get number of triangles.

int niftk::BasicMesh::GetNumVerts ( )
inline

Get number of vertices.

BasicTriangle& niftk::BasicMesh::GetTri ( int  index)
inline

Get reference to the triangle with the specified index.

const BasicTriangle& niftk::BasicMesh::GetTri ( int  index) const
inline

Get const reference to the triangle with the specified index.

BasicVertex& niftk::BasicMesh::GetVertex ( int  index)
inline

Get reference to the vertex with the specified index.

const BasicVertex& niftk::BasicMesh::GetVertex ( int  index) const
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].

BasicMesh & niftk::BasicMesh::operator= ( const BasicMesh other)

Assignment operator.

void niftk::BasicMesh::PrintStatus ( )

Print mesh state to std::cout.

void niftk::BasicMesh::SetNumTriangles ( int  n)
inline

Set number of triangles.

void niftk::BasicMesh::SetNumVerts ( int  n)
inline

Set number of vertices.


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