NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Simple triangle implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. It keeps hold of vertices, triangle index and has an active flag. More...
Public Member Functions | |
BasicTriangle () | |
Default constructor. More... | |
BasicTriangle (int v1, int v2, int v3) | |
Constructor with vertex indices as parameters. More... | |
BasicTriangle (BasicMesh *mp, int v1, int v2, int v3) | |
Constructor with mesh pointer and vertex indices as parameters. More... | |
virtual | ~BasicTriangle () |
Destructors. More... | |
BasicTriangle (const BasicTriangle &t) | |
Copy constructor. More... | |
BasicTriangle & | operator= (const BasicTriangle &t) |
Assignment operator. More... | |
bool | operator== (const BasicTriangle &t) |
Comparison operator. It assumes pointing to same list of verts. More... | |
void | ChangeMesh (BasicMesh *mp) |
Changes the mesh pointer to the specified one. More... | |
bool | IsActive () const |
Returns true if the triangle active, false if it was removed from the mesh. More... | |
void | SetActive (bool b) |
Sets the active status of the triangle. False = triangle was removed. More... | |
bool | HasVertex (int vi) |
Returns true if the triangle has a specific vertex (checked by index) More... | |
void | ChangeVertex (int vFrom, int vTo) |
Changes a member vertex to another. When we collapse an edge, we need to change the vertex of a BasicTriangle. More... | |
void | GetVertIndices (int &v1, int &v2, int &v3) |
Gets the currently stored vertex indices. More... | |
const float * | GetVert1CoordArray () |
Gets the coordinates of the first member vertex as a float array. More... | |
const float * | GetVert2CoordArray () |
Gets the coordinates of the second member vertex as a float array. More... | |
const float * | GetVert3CoordArray () |
Gets the coordinates of the third member vertex as a float array. More... | |
const BasicVec3D & | GetVert1Coords () const |
Gets the const reference to the coordinates (Vec3D) of the first member vertex. More... | |
const BasicVec3D & | GetVert2Coords () const |
Gets the const reference to the coordinates (Vec3D) of the second member vertex. More... | |
const BasicVec3D & | GetVert3Coords () const |
Gets the const reference to the coordinates (Vec3D) of the third member vertex. More... | |
const BasicVertex & | GetVert1 () const |
Gets the const reference to the first member vertex. More... | |
const BasicVertex & | GetVert2 () const |
Gets the const reference to the second member vertex. More... | |
const BasicVertex & | GetVert3 () const |
Gets the const reference to the third member vertex. More... | |
const float * | GetVert1NormalArray () |
Gets the coordinates of the first member vertex's normal as a float array. More... | |
const float * | GetVert2NormalArray () |
Gets the coordinates of the second member vertex's normal as a float array. More... | |
const float * | GetVert3NormalArray () |
Gets the coordinates of the third member vertex's normal as a float array. More... | |
const BasicVec3D & | GetVert1Normal () const |
Gets the const reference to the coordinates (Vec3D) of the first member vertex's normal. More... | |
const BasicVec3D & | GetVert2Normal () const |
Gets the const reference to the coordinates (Vec3D) of the second member vertex's normal. More... | |
const BasicVec3D & | GetVert3Normal () const |
Gets the const reference to the coordinates (Vec3D) of the third member vertex's normal. More... | |
void | SetTriNormal (BasicVec3D triNorm) |
Sets the triangle normal (as Vec3D) More... | |
const BasicVec3D & | GetTriNormal () const |
Gets const refernece to the triangle normal (as Vec3D) More... | |
float * | GetTriNormalArray () |
Gets the coordinates of the triangle normal as a float[3] array. More... | |
float | GetTriNormalX () |
Gets the X component of the triangle normal. More... | |
float | GetTriNormalY () |
Gets the Y component of the triangle normal. More... | |
float | GetTriNormalZ () |
Gets the Z component of the triangle normal. More... | |
void | SetTriNormalX (float nx) |
Sets the X component of the triangle normal. More... | |
void | SetTriNormalY (float ny) |
Sets the Y component of the triangle normal. More... | |
void | SetTriNormalZ (float nz) |
Sets the Z component of the triangle normal. More... | |
void | CalcNormal () |
Re-computes the normal for the BasicTriangle. More... | |
float | CalcArea () |
Returns area of BasicTriangle. More... | |
int | GetVertIndex (int which) |
Returns the index of the member vertex with the specifed index (0-2) More... | |
void | SetVertIndex (int which, int indexVal) |
Sets the index of the member vertex with the specifed index (0-2) More... | |
int | GetVert1Index () const |
Returns the index of the first member vertex. More... | |
int | GetVert2Index () const |
Returns the index of the second member vertex. More... | |
int | GetVert3Index () const |
Returns the index of the third member vertex. More... | |
void | SetVert1Index (int v1) |
Sets the index of the first member vertex. More... | |
void | SetVert2Index (int v2) |
Sets the index of the second member vertex. More... | |
void | SetVert3Index (int v3) |
Sets the index of the third member vertex. More... | |
int | GetIndex () const |
Returns the index of the current triangle. More... | |
void | SetIndex (int i) |
Sets the index of the current triangle. More... | |
float | GetDParam () const |
Returns the'd' is from the plane equation ax + by + cz + d = 0. More... | |
void | SetDParam (float d) |
Sets the'd' parameter of the plane equation ax + by + cz + d = 0. More... | |
Protected Attributes | |
int | m_Vert1 |
int | m_Vert2 |
int | m_Vert3 |
BasicVec3D | m_TriNormal |
float | m_TriNormalArray [3] |
float | m_DParam |
bool | m_Active |
BasicMesh * | m_Mesh |
int | m_Index |
Friends | |
std::ostream & | operator<< (std::ostream &os, const BasicTriangle &to) |
Output to file or stream. More... | |
Simple triangle implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. It keeps hold of vertices, triangle index and has an active flag.
niftk::BasicTriangle::BasicTriangle | ( | ) |
Default constructor.
Constructor with vertex indices as parameters.
Constructor with mesh pointer and vertex indices as parameters.
|
virtual |
Destructors.
niftk::BasicTriangle::BasicTriangle | ( | const BasicTriangle & | t | ) |
Copy constructor.
float niftk::BasicTriangle::CalcArea | ( | ) |
Returns area of BasicTriangle.
void niftk::BasicTriangle::CalcNormal | ( | ) |
Re-computes the normal for the BasicTriangle.
Changes the mesh pointer to the specified one.
Changes a member vertex to another. When we collapse an edge, we need to change the vertex of a BasicTriangle.
FIX error
|
inline |
Returns the'd' is from the plane equation ax + by + cz + d = 0.
|
inline |
Returns the index of the current triangle.
|
inline |
Gets const refernece to the triangle normal (as Vec3D)
float * niftk::BasicTriangle::GetTriNormalArray | ( | ) |
Gets the coordinates of the triangle normal as a float[3] array.
|
inline |
Gets the X component of the triangle normal.
|
inline |
Gets the Y component of the triangle normal.
|
inline |
Gets the Z component of the triangle normal.
const BasicVertex & niftk::BasicTriangle::GetVert1 | ( | ) | const |
Gets the const reference to the first member vertex.
const float * niftk::BasicTriangle::GetVert1CoordArray | ( | ) |
Gets the coordinates of the first member vertex as a float array.
const BasicVec3D & niftk::BasicTriangle::GetVert1Coords | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the first member vertex.
|
inline |
Returns the index of the first member vertex.
const BasicVec3D & niftk::BasicTriangle::GetVert1Normal | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the first member vertex's normal.
const float * niftk::BasicTriangle::GetVert1NormalArray | ( | ) |
Gets the coordinates of the first member vertex's normal as a float array.
const BasicVertex & niftk::BasicTriangle::GetVert2 | ( | ) | const |
Gets the const reference to the second member vertex.
const float * niftk::BasicTriangle::GetVert2CoordArray | ( | ) |
Gets the coordinates of the second member vertex as a float array.
const BasicVec3D & niftk::BasicTriangle::GetVert2Coords | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the second member vertex.
|
inline |
Returns the index of the second member vertex.
const BasicVec3D & niftk::BasicTriangle::GetVert2Normal | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the second member vertex's normal.
const float * niftk::BasicTriangle::GetVert2NormalArray | ( | ) |
Gets the coordinates of the second member vertex's normal as a float array.
const BasicVertex & niftk::BasicTriangle::GetVert3 | ( | ) | const |
Gets the const reference to the third member vertex.
const float * niftk::BasicTriangle::GetVert3CoordArray | ( | ) |
Gets the coordinates of the third member vertex as a float array.
const BasicVec3D & niftk::BasicTriangle::GetVert3Coords | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the third member vertex.
|
inline |
Returns the index of the third member vertex.
const BasicVec3D & niftk::BasicTriangle::GetVert3Normal | ( | ) | const |
Gets the const reference to the coordinates (Vec3D) of the third member vertex's normal.
const float * niftk::BasicTriangle::GetVert3NormalArray | ( | ) |
Gets the coordinates of the third member vertex's normal as a float array.
Returns the index of the member vertex with the specifed index (0-2)
Gets the currently stored vertex indices.
bool niftk::BasicTriangle::HasVertex | ( | int | vi | ) |
Returns true if the triangle has a specific vertex (checked by index)
|
inline |
Returns true if the triangle active, false if it was removed from the mesh.
BasicTriangle & niftk::BasicTriangle::operator= | ( | const BasicTriangle & | t | ) |
Assignment operator.
bool niftk::BasicTriangle::operator== | ( | const BasicTriangle & | t | ) |
Comparison operator. It assumes pointing to same list of verts.
|
inline |
Sets the active status of the triangle. False = triangle was removed.
|
inline |
Sets the'd' parameter of the plane equation ax + by + cz + d = 0.
|
inline |
Sets the triangle normal (as Vec3D)
|
inline |
Sets the X component of the triangle normal.
|
inline |
Sets the Y component of the triangle normal.
|
inline |
Sets the Z component of the triangle normal.
Sets the index of the first member vertex.
Sets the index of the second member vertex.
Sets the index of the third member vertex.
Sets the index of the member vertex with the specifed index (0-2)
|
friend |
Output to file or stream.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |