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

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...
 
BasicVertexoperator= (const BasicVertex &v)
 Assignment operator. More...
 
BasicVertexoperator= (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...
 
BasicVec3DGetCoords ()
 Get coordinates as 3D vector. More...
 
const BasicVec3DGetCoords () 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...
 
BasicVec3DGetNormal ()
 Get normal as 3D vector. More...
 
const BasicVec3DGetNormal () 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...
 

Detailed Description

Simple vertex implementation that is used in the Surface Extraction and surface smoothing and decimation algorithms. It has both a position and a normal.

Constructor & Destructor Documentation

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.

niftk::BasicVertex::~BasicVertex ( )
virtual

destructor

Member Function Documentation

void niftk::BasicVertex::AddTriNeighbor ( int  t)
inline

Add a triangle neighbor - a triangle which uses this vertex.

void niftk::BasicVertex::AddVertNeighbor ( int  v)
inline

Add neighbor - a vertex that is connected by an edge.

void niftk::BasicVertex::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)

void niftk::BasicVertex::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.

const float * niftk::BasicVertex::GetCoordArray ( ) const

Get the whole coordinate array as a float[3] array.

BasicVec3D& niftk::BasicVertex::GetCoords ( )
inline

Get coordinates as 3D vector.

const BasicVec3D& niftk::BasicVertex::GetCoords ( ) const
inline

Set coordinates as 3D vector - const.

float niftk::BasicVertex::GetCoordX ( )
inline

Get X coordinate of the vertex.

const float niftk::BasicVertex::GetCoordX ( ) const
inline

Get X coordinate of the vertex - const.

float niftk::BasicVertex::GetCoordY ( )
inline

Get Y coordinate of the vertex.

const float niftk::BasicVertex::GetCoordY ( ) const
inline

Get Y coordinate of the vertex - const.

float niftk::BasicVertex::GetCoordZ ( )
inline

Get Z coordinate of the vertex.

const float niftk::BasicVertex::GetCoordZ ( ) const
inline

Get Z coordinate of the vertex - const.

double niftk::BasicVertex::GetCost ( ) const
inline

Returns the cost of removing this vertex from the mesh.

double niftk::BasicVertex::GetEdgeRemoveCost ( )
inline

Returns the edge remove costs that is used in mesh simplification.

int niftk::BasicVertex::GetIndex ( ) const
inline

Get index of the current vertex.

int niftk::BasicVertex::GetMinCostEdgeVert ( ) const
inline

Returns the index of the vertex that is at other end of the min. cost edge (used in mesh simplification)

BasicVec3D& niftk::BasicVertex::GetNormal ( )
inline

Get normal as 3D vector.

const BasicVec3D& niftk::BasicVertex::GetNormal ( ) const
inline

Get normal as 3D vector - const.

const float * niftk::BasicVertex::GetNormalArray ( ) const

Get the whole normal array as a float[3] array.

float niftk::BasicVertex::GetNormalX ( )
inline

Get X coordinate of the vertex normal.

const float niftk::BasicVertex::GetNormalX ( ) const
inline

Get X coordinate of the vertex normal - const.

float niftk::BasicVertex::GetNormalY ( )
inline

Get Y coordinate of the vertex normal.

const float niftk::BasicVertex::GetNormalY ( ) const
inline

Get Y coordinate of the vertex normal - const.

float niftk::BasicVertex::GetNormalZ ( )
inline

Get Z coordinate of the vertex normal.

const float niftk::BasicVertex::GetNormalZ ( ) const
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.

double niftk::BasicVertex::GetQuadricSummedTriArea ( )
inline

Gets the quadric cost function summed over the triangle area.

const std::set<int>& niftk::BasicVertex::GetTriNeighbors ( ) const
inline

Get the whole set of triangle neighbours - const.

std::set<int>& niftk::BasicVertex::GetTriNeighbors ( )
inline

Get the whole set of triangle neighbours.

const std::set<int>& niftk::BasicVertex::GetVertNeighbors ( ) const
inline

Get the whole set of vertex neighbours - const.

std::set<int>& niftk::BasicVertex::GetVertNeighbors ( )
inline
bool niftk::BasicVertex::HasTriNeighbor ( int  t) const
inline

Check is vertex has a certain triangle neighbour.

bool niftk::BasicVertex::HasVertNeighbor ( int  v) const
inline

Check is vertex has a certain vertex neighbour.

bool niftk::BasicVertex::IsActive ( ) const
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

unsigned niftk::BasicVertex::RemoveTriNeighbor ( int  t)
inline

Remove triangle if it no longer uses this vertex.

unsigned niftk::BasicVertex::RemoveVertNeighbor ( int  v)
inline

Remove a vertex which is no longer connected by an edge.

void niftk::BasicVertex::SetActive ( bool  b)
inline

Sets a flag the flag that indicates if the vertex is active (true) or it was removed (false) from the mesh.

void niftk::BasicVertex::SetCoords ( const BasicVec3D v)
inline

Set coordinates as 3D vector.

void niftk::BasicVertex::SetCoordX ( float  x)
inline

Set X coordinate of the vertex individually.

void niftk::BasicVertex::SetCoordY ( float  y)
inline

Set Y coordinate of the vertex individually.

void niftk::BasicVertex::SetCoordZ ( float  z)
inline

Set Z coordinate of the vertex individually.

void niftk::BasicVertex::SetEdgeRemoveCost ( double  f)
inline

Sets the edge remove costs that is used in mesh simplification.

void niftk::BasicVertex::SetIndex ( int  i)
inline

Set index of the current vertex.

void niftk::BasicVertex::SetMinCostEdgeVert ( int  i)
inline

Sets the index of the vertex that is at other end of the min. cost edge (used in mesh simplification)

void niftk::BasicVertex::SetNormal ( const BasicVec3D vn)
inline

Set normal as 3D vector.

void niftk::BasicVertex::SetNormalX ( float  x)
inline

Set X coordinate of the vertex normal individually.

void niftk::BasicVertex::SetNormalY ( float  y)
inline

Set Y coordinate of the vertex normal individually.

void niftk::BasicVertex::SetNormalZ ( float  z)
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.

void niftk::BasicVertex::SetQuadricSummedTriArea ( double  newArea)
inline

Sets the quadric cost function summed over the triangle area.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const BasicVertex vo 
)
friend

Output to std::stream.


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