NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Simple vertex implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. It has both a position and a normal. More...
Public Member Functions | |
BasicVertex () | |
Default constructor. More... | |
BasicVertex (float x1, float y1, float z1) | |
Constructor with coordinates as parameters. More... | |
BasicVertex (float av[3]) | |
Constructor with coordinates as parameters in an array. More... | |
BasicVertex (float av[3], float vn[3]) | |
Constructor with coordinates and normals as parameters in arrays. More... | |
BasicVertex (const BasicVertex &v) | |
Copy constructor. More... | |
virtual | ~BasicVertex () |
destructor More... | |
BasicVertex & | operator= (const BasicVertex &v) |
Assignment operator. More... | |
BasicVertex & | operator= (const float av[3]) |
Assignment operator. More... | |
bool | operator== (const BasicVertex &v) |
Comparison operator. More... | |
bool | operator!= (const BasicVertex &v) |
Comparison operator - not equal. More... | |
bool | operator< (const BasicVertex &right) const |
operator< is used to order vertices by edge removal costs More... | |
bool | operator> (const BasicVertex &right) const |
operator> is used to order vertices by edge removal costs More... | |
void | SetCoords (const BasicVec3D &v) |
Set coordinates as 3D vector. More... | |
BasicVec3D & | GetCoords () |
Get coordinates as 3D vector. More... | |
const BasicVec3D & | GetCoords () const |
Set coordinates as 3D vector - const. More... | |
const float * | GetCoordArray () const |
Get the whole coordinate array as a float[3] array. More... | |
void | SetCoordX (float x) |
Set X coordinate of the vertex individually. More... | |
void | SetCoordY (float y) |
Set Y coordinate of the vertex individually. More... | |
void | SetCoordZ (float z) |
Set Z coordinate of the vertex individually. More... | |
float | GetCoordX () |
Get X coordinate of the vertex. More... | |
float | GetCoordY () |
Get Y coordinate of the vertex. More... | |
float | GetCoordZ () |
Get Z coordinate of the vertex. More... | |
const float | GetCoordX () const |
Get X coordinate of the vertex - const. More... | |
const float | GetCoordY () const |
Get Y coordinate of the vertex - const. More... | |
const float | GetCoordZ () const |
Get Z coordinate of the vertex - const. More... | |
void | SetNormal (const BasicVec3D &vn) |
Set normal as 3D vector. More... | |
BasicVec3D & | GetNormal () |
Get normal as 3D vector. More... | |
const BasicVec3D & | GetNormal () const |
Get normal as 3D vector - const. More... | |
const float * | GetNormalArray () const |
Get the whole normal array as a float[3] array. More... | |
void | SetNormalX (float x) |
Set X coordinate of the vertex normal individually. More... | |
void | SetNormalY (float y) |
Set Y coordinate of the vertex normal individually. More... | |
void | SetNormalZ (float z) |
Set Z coordinate of the vertex normal individually. More... | |
float | GetNormalX () |
Get X coordinate of the vertex normal. More... | |
float | GetNormalY () |
Get Y coordinate of the vertex normal. More... | |
float | GetNormalZ () |
Get Z coordinate of the vertex normal. More... | |
const float | GetNormalX () const |
Get X coordinate of the vertex normal - const. More... | |
const float | GetNormalY () const |
Get Y coordinate of the vertex normal - const. More... | |
const float | GetNormalZ () const |
Get Z coordinate of the vertex normal - const. More... | |
void | AddVertNeighbor (int v) |
Add neighbor - a vertex that is connected by an edge. More... | |
unsigned | RemoveVertNeighbor (int v) |
Remove a vertex which is no longer connected by an edge. More... | |
void | AddTriNeighbor (int t) |
Add a triangle neighbor - a triangle which uses this vertex. More... | |
unsigned | RemoveTriNeighbor (int t) |
Remove triangle if it no longer uses this vertex. More... | |
const std::set< int > & | GetVertNeighbors () const |
Get the whole set of vertex neighbours - const. More... | |
std::set< int > & | GetVertNeighbors () |
const std::set< int > & | GetTriNeighbors () const |
Get the whole set of triangle neighbours - const. More... | |
std::set< int > & | GetTriNeighbors () |
Get the whole set of triangle neighbours. More... | |
bool | HasVertNeighbor (int v) const |
Check is vertex has a certain vertex neighbour. More... | |
bool | HasTriNeighbor (int t) const |
Check is vertex has a certain triangle neighbour. More... | |
double | GetEdgeRemoveCost () |
Returns the edge remove costs that is used in mesh simplification. More... | |
void | SetEdgeRemoveCost (double f) |
Sets the edge remove costs that is used in mesh simplification. More... | |
int | GetMinCostEdgeVert () const |
Returns the index of the vertex that is at other end of the min. cost edge (used in mesh simplification) More... | |
void | SetMinCostEdgeVert (int i) |
Sets the index of the vertex that is at other end of the min. cost edge (used in mesh simplification) More... | |
double | GetCost () const |
Returns the cost of removing this vertex from the mesh. More... | |
int | GetIndex () const |
Get index of the current vertex. More... | |
void | SetIndex (int i) |
Set index of the current vertex. More... | |
bool | IsActive () const |
Returns the flag value that indicates if the vertex is active (true) or it was removed (false) from the mesh. More... | |
void | SetActive (bool b) |
Sets a flag the flag that indicates if the vertex is active (true) or it was removed (false) from the mesh. More... | |
bool | IsBorder (BasicMesh &m) |
Checks if the current vertex is on the border of the mesh (i.e. is there an edge which uses this vertex which is only used for one triangle?) More... | |
void | GetAllBorderEdges (std::set< Border > &borderSet, BasicMesh &m) |
Gets the set of border edges Is the current vertex on an edge? If so, get edge information. This is used to put constraints on the border so that the mesh edges aren't "eaten away" by the mesh simplification. More... | |
void | CalcQuadric (BasicMesh &m, bool bUseTriArea) |
Evaluate the quadric cost function for the current vertex Used for Garland & Heckbert's quadric edge collapse cost (used for mesh simplifications/progressive meshes) More... | |
void | GetQuadric (double Qret[4][4]) |
Returns the quadric cost function for the current vertex. More... | |
void | SetQuadric (double Qnew[4][4]) |
Sets the quadric cost function for the current vertex. More... | |
double | GetQuadricSummedTriArea () |
Gets the quadric cost function summed over the triangle area. More... | |
void | SetQuadricSummedTriArea (double newArea) |
Sets the quadric cost function summed over the triangle area. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, const BasicVertex &) |
Output to std::stream. More... | |
Simple vertex implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. It has both a position and a normal.
niftk::BasicVertex::BasicVertex | ( | ) |
Default constructor.
niftk::BasicVertex::BasicVertex | ( | float | x1, |
float | y1, | ||
float | z1 | ||
) |
Constructor with coordinates as parameters.
niftk::BasicVertex::BasicVertex | ( | float | av[3] | ) |
Constructor with coordinates as parameters in an array.
niftk::BasicVertex::BasicVertex | ( | float | av[3], |
float | vn[3] | ||
) |
Constructor with coordinates and normals as parameters in arrays.
niftk::BasicVertex::BasicVertex | ( | const BasicVertex & | v | ) |
Copy constructor.
|
virtual |
destructor
Add a triangle neighbor - a triangle which uses this vertex.
Add neighbor - a vertex that is connected by an edge.
Evaluate the quadric cost function for the current vertex Used for Garland & Heckbert's quadric edge collapse cost (used for mesh simplifications/progressive meshes)
Gets the set of border edges Is the current vertex on an edge? If so, get edge information. This is used to put constraints on the border so that the mesh edges aren't "eaten away" by the mesh simplification.
const float * niftk::BasicVertex::GetCoordArray | ( | ) | const |
Get the whole coordinate array as a float[3] array.
|
inline |
Get coordinates as 3D vector.
|
inline |
Set coordinates as 3D vector - const.
|
inline |
Get X coordinate of the vertex.
|
inline |
Get X coordinate of the vertex - const.
|
inline |
Get Y coordinate of the vertex.
|
inline |
Get Y coordinate of the vertex - const.
|
inline |
Get Z coordinate of the vertex.
|
inline |
Get Z coordinate of the vertex - const.
|
inline |
Returns the cost of removing this vertex from the mesh.
|
inline |
Returns the edge remove costs that is used in mesh simplification.
|
inline |
Get index of the current vertex.
|
inline |
Returns the index of the vertex that is at other end of the min. cost edge (used in mesh simplification)
|
inline |
Get normal as 3D vector.
|
inline |
Get normal as 3D vector - const.
const float * niftk::BasicVertex::GetNormalArray | ( | ) | const |
Get the whole normal array as a float[3] array.
|
inline |
Get X coordinate of the vertex normal.
|
inline |
Get X coordinate of the vertex normal - const.
|
inline |
Get Y coordinate of the vertex normal.
|
inline |
Get Y coordinate of the vertex normal - const.
|
inline |
Get Z coordinate of the vertex normal.
|
inline |
Get Z coordinate of the vertex normal - const.
void niftk::BasicVertex::GetQuadric | ( | double | Qret[4][4] | ) |
Returns the quadric cost function for the current vertex.
|
inline |
Gets the quadric cost function summed over the triangle area.
|
inline |
Get the whole set of triangle neighbours - const.
|
inline |
Get the whole set of triangle neighbours.
|
inline |
Get the whole set of vertex neighbours - const.
|
inline |
|
inline |
Check is vertex has a certain triangle neighbour.
|
inline |
Check is vertex has a certain vertex neighbour.
|
inline |
Returns the flag value that indicates if the vertex is active (true) or it was removed (false) from the mesh.
bool niftk::BasicVertex::IsBorder | ( | BasicMesh & | m | ) |
Checks if the current vertex is on the border of the mesh (i.e. is there an edge which uses this vertex which is only used for one triangle?)
bool niftk::BasicVertex::operator!= | ( | const BasicVertex & | v | ) |
Comparison operator - not equal.
bool niftk::BasicVertex::operator< | ( | const BasicVertex & | right | ) | const |
operator< is used to order vertices by edge removal costs
BasicVertex & niftk::BasicVertex::operator= | ( | const BasicVertex & | v | ) |
Assignment operator.
BasicVertex & niftk::BasicVertex::operator= | ( | const float | av[3] | ) |
Assignment operator.
bool niftk::BasicVertex::operator== | ( | const BasicVertex & | v | ) |
Comparison operator.
bool niftk::BasicVertex::operator> | ( | const BasicVertex & | right | ) | const |
operator> is used to order vertices by edge removal costs
|
inline |
Remove triangle if it no longer uses this vertex.
|
inline |
Remove a vertex which is no longer connected by an edge.
|
inline |
Sets a flag the flag that indicates if the vertex is active (true) or it was removed (false) from the mesh.
|
inline |
Set coordinates as 3D vector.
|
inline |
Set X coordinate of the vertex individually.
|
inline |
Set Y coordinate of the vertex individually.
|
inline |
Set Z coordinate of the vertex individually.
|
inline |
Sets the edge remove costs that is used in mesh simplification.
Sets the index of the vertex that is at other end of the min. cost edge (used in mesh simplification)
|
inline |
Set normal as 3D vector.
|
inline |
Set X coordinate of the vertex normal individually.
|
inline |
Set Y coordinate of the vertex normal individually.
|
inline |
Set Z coordinate of the vertex normal individually.
void niftk::BasicVertex::SetQuadric | ( | double | Qnew[4][4] | ) |
Sets the quadric cost function for the current vertex.
|
inline |
Sets the quadric cost function summed over the triangle area.
|
friend |
Output to std::stream.