VectorEntity
1.1.0
Medical Data Segmentation Toolkit
|
Triangle in 3D space, component of a polygonal mesh. More...
#include <mctri.h>
Public Member Functions | |
void | ChangeVertex (MCVertex *old_uzel, MCVertex *new_uzel) |
Exchanges one of the triangle vertices. | |
int | CompareTriOrientation (MCTri *test_tri) |
Compares orientation of two triangles. | |
void | DeRegistration () |
Deregistration of triangle from vertices. | |
template<class S > | |
void | DeserializeEntity (mds::mod::CChannelSerializer< S > &Reader, std::vector< MCVertex * > &index_array) |
Deserializes the triangle. | |
double | GetArea () |
Returns area of the triangle. | |
void | GetCenter (MCPoint3D &_center) |
Returns coordinates of the triangle's center. | |
double | GetCircuit () |
Returns perimeter of the triangle. | |
MCEdge * | GetEdge (int hrana) |
Returns a specified triangle edge, or NULL if no such edge exists. | |
void | GetEdge (int index, MCVertex **_u0, MCVertex **_u1) |
Returns pointers to all triangle vertices. | |
void | GetEdges (MCEdge *hrany[3]) |
Returns all triangle edges, or NULL if no edges exist. | |
unsigned int | GetHashCode () const |
Returns triangle hash code. | |
double | GetMaxEdge (MCVertex **_u0, MCVertex **_u1) |
Returns length and vertices of the longest edge. | |
double | GetMaxEdge (MCEdge **max_hrana) |
Returns pointer to a longest edge, or NULL on failure. | |
int | GetMaxEdge () |
Returns index of the longest edge. | |
double | GetMaxEdgeLength () |
Returns length of the longest edge. | |
double | GetMinEdgeLength () |
Returns length of the shortest edge. | |
MCTri * | GetNeighbour (int _index) |
Returns pointer to a specific triangle. | |
void | GetNeighbours (MCTri *_pole[3]) |
Returns pointers to neighbouring triangles. | |
MCVector3D | GetNormal () |
Returns normal of the triangle normalized so that its length is equal to one. | |
void | GetNormal (MCVector3D &normala) |
Returns normal of the triangle normalized so that its length is equal to one. | |
void | GetPlane (double &A, double &B, double &C, double &D) |
Returns parameters of the triangle's plane. | |
double | GetQuality () |
Returns quality of the triangle. | |
void | GetRestEdge (MCVertex *_uzel, MCVertex **_u0, MCVertex **_u1) |
Returns two remaining vertices. | |
MCVertex * | GetRestVertex (MCVertex *_u0, MCVertex *_u1) |
Returns a remaining vertex, or NULL. | |
MCVertex * | GetVertex (int index) |
Return pointer to a specified vertex. | |
MCTri * | GetVertexTri (MCVertex *_uzel) |
Returns a registered triangle in a given vertex. | |
void | GetVerticeS (MCVertex **_u0, MCVertex **_u1, MCVertex **_u2) const |
Returns pointer to all triangle vertices. | |
void | GetVerticeS (MCVertex *_u[3]) const |
Returns pointer to all triangle vertices. | |
void | InverseOrientation () |
Changes orientation of the triangle. | |
int | IsVertex (MCVertex *test_uzel) const |
Checks if a given vertex belongs to the triangle. | |
bool | IsVertexBool (MCVertex *test_uzel) const |
Checks if a given vertex belongs to the triangle. | |
void | Load (std::ifstream &proud, std::vector< MCVertex * > &_pole) |
Loads triangle (indexes of vertices) from a given stream. | |
MCTri () | |
Default constructor. | |
MCTri (const MCTri &_tri) | |
Copy constructor. | |
MCTri (MCTri *_tri) | |
Constructor. | |
MCTri (MCVertex *_u0, MCVertex *_u1, MCVertex *_u2) | |
Constructor. | |
MCTri (MCVertex *_u[3]) | |
Constructor. | |
void | Registration () |
Registers the triangle into its vertices. | |
void | Save (std::ofstream &proud) |
Saves triangle (indexes of vertices) into a stream. | |
template<class S > | |
void | SerializeEntity (mds::mod::CChannelSerializer< S > &Writer) |
Serializes the triangle. | |
void | SetVertex (int index, MCVertex *new_uzel) |
Sets pointer to one of the vertices. | |
void | SetVertexTri (MCVertex *_uzel, MCTri *_tri) |
Sets pointer to a triangle registered in a given vertex. | |
void | SetVerticeS (MCVertex *_u0, MCVertex *_u1, MCVertex *_u2) |
Sets pointers to all triangle vertices. | |
void | SetVerticeS (MCVertex *_u[3]) |
Sets pointers to all triangle vertices. | |
bool | TestIdentity (MCTri *test_tri) const |
Checks of two triangles are equal. | |
virtual std::string | ToString () const |
Returns text description of the triangle. | |
virtual | ~MCTri () |
Empty destructor. | |
Protected Types | |
typedef MCEntity< MCTri > | tBase |
Base class. | |
Protected Attributes | |
MCTri * | s [3] |
Pointers to triangles sharing the corresponding vertex. | |
MCVertex * | u [3] |
Pointers to all triangle vertices. |
Triangle in 3D space, component of a polygonal mesh.
typedef MCEntity<MCTri> vctl::MCTri::tBase [protected] |
Base class.
vctl::MCTri::MCTri | ( | ) | [inline] |
Default constructor.
vctl::MCTri::MCTri | ( | const MCTri & | _tri | ) | [inline] |
Copy constructor.
vctl::MCTri::MCTri | ( | MCTri * | _tri | ) | [inline] |
Constructor.
vctl::MCTri::MCTri | ( | MCVertex * | _u0, |
MCVertex * | _u1, | ||
MCVertex * | _u2 | ||
) | [inline] |
Constructor.
vctl::MCTri::MCTri | ( | MCVertex * | _u[3] | ) | [inline] |
Constructor.
virtual vctl::MCTri::~MCTri | ( | ) | [inline, virtual] |
Empty destructor.
void vctl::MCTri::ChangeVertex | ( | MCVertex * | old_uzel, |
MCVertex * | new_uzel | ||
) | [inline] |
Exchanges one of the triangle vertices.
int MCTri::CompareTriOrientation | ( | MCTri * | test_tri | ) |
Compares orientation of two triangles.
void MCTri::DeRegistration | ( | ) |
Deregistration of triangle from vertices.
void vctl::MCTri::DeserializeEntity | ( | mds::mod::CChannelSerializer< S > & | Reader, |
std::vector< MCVertex * > & | index_array | ||
) | [inline] |
Deserializes the triangle.
double MCTri::GetArea | ( | ) |
Returns area of the triangle.
void MCTri::GetCenter | ( | MCPoint3D & | _center | ) |
Returns coordinates of the triangle's center.
Returns perimeter of the triangle.
MCEdge * MCTri::GetEdge | ( | int | hrana | ) |
Returns a specified triangle edge, or NULL if no such edge exists.
void MCTri::GetEdge | ( | int | index, |
MCVertex ** | _u0, | ||
MCVertex ** | _u1 | ||
) |
Returns pointers to all triangle vertices.
void MCTri::GetEdges | ( | MCEdge * | hrany[3] | ) |
Returns all triangle edges, or NULL if no edges exist.
unsigned int vctl::MCTri::GetHashCode | ( | ) | const [inline, virtual] |
Returns triangle hash code.
Implements vctl::MCEntity< MCTri >.
double MCTri::GetMaxEdge | ( | MCVertex ** | _u0, |
MCVertex ** | _u1 | ||
) |
Returns length and vertices of the longest edge.
double MCTri::GetMaxEdge | ( | MCEdge ** | max_hrana | ) |
Returns pointer to a longest edge, or NULL on failure.
int MCTri::GetMaxEdge | ( | ) |
Returns index of the longest edge.
Returns length of the longest edge.
Returns length of the shortest edge.
MCTri * MCTri::GetNeighbour | ( | int | _index | ) |
Returns pointer to a specific triangle.
void MCTri::GetNeighbours | ( | MCTri * | _pole[3] | ) |
Returns pointers to neighbouring triangles.
Returns normal of the triangle normalized so that its length is equal to one.
void MCTri::GetNormal | ( | MCVector3D & | normala | ) |
Returns normal of the triangle normalized so that its length is equal to one.
void MCTri::GetPlane | ( | double & | A, |
double & | B, | ||
double & | C, | ||
double & | D | ||
) |
Returns parameters of the triangle's plane.
double vctl::MCTri::GetQuality | ( | ) | [inline] |
Returns quality of the triangle.
void MCTri::GetRestEdge | ( | MCVertex * | _uzel, |
MCVertex ** | _u0, | ||
MCVertex ** | _u1 | ||
) |
Returns two remaining vertices.
MCVertex * MCTri::GetRestVertex | ( | MCVertex * | _u0, |
MCVertex * | _u1 | ||
) |
Returns a remaining vertex, or NULL.
MCVertex* vctl::MCTri::GetVertex | ( | int | index | ) | [inline] |
Return pointer to a specified vertex.
MCTri* vctl::MCTri::GetVertexTri | ( | MCVertex * | _uzel | ) | [inline] |
Returns a registered triangle in a given vertex.
void vctl::MCTri::GetVerticeS | ( | MCVertex ** | _u0, |
MCVertex ** | _u1, | ||
MCVertex ** | _u2 | ||
) | const [inline] |
Returns pointer to all triangle vertices.
void vctl::MCTri::GetVerticeS | ( | MCVertex * | _u[3] | ) | const [inline] |
Returns pointer to all triangle vertices.
void MCTri::InverseOrientation | ( | ) |
Changes orientation of the triangle.
int vctl::MCTri::IsVertex | ( | MCVertex * | test_uzel | ) | const [inline] |
Checks if a given vertex belongs to the triangle.
bool vctl::MCTri::IsVertexBool | ( | MCVertex * | test_uzel | ) | const [inline] |
Checks if a given vertex belongs to the triangle.
void vctl::MCTri::Load | ( | std::ifstream & | proud, |
std::vector< MCVertex * > & | _pole | ||
) |
Loads triangle (indexes of vertices) from a given stream.
void vctl::MCTri::Registration | ( | ) | [inline] |
Registers the triangle into its vertices.
void vctl::MCTri::Save | ( | std::ofstream & | proud | ) |
Saves triangle (indexes of vertices) into a stream.
void vctl::MCTri::SerializeEntity | ( | mds::mod::CChannelSerializer< S > & | Writer | ) | [inline] |
Serializes the triangle.
Reimplemented from vctl::MCEntity< MCTri >.
void vctl::MCTri::SetVertex | ( | int | index, |
MCVertex * | new_uzel | ||
) | [inline] |
Sets pointer to one of the vertices.
void vctl::MCTri::SetVertexTri | ( | MCVertex * | _uzel, |
MCTri * | _tri | ||
) | [inline] |
Sets pointer to a triangle registered in a given vertex.
void vctl::MCTri::SetVerticeS | ( | MCVertex * | _u0, |
MCVertex * | _u1, | ||
MCVertex * | _u2 | ||
) | [inline] |
Sets pointers to all triangle vertices.
void vctl::MCTri::SetVerticeS | ( | MCVertex * | _u[3] | ) | [inline] |
Sets pointers to all triangle vertices.
bool vctl::MCTri::TestIdentity | ( | MCTri * | test_tri | ) | const [inline, virtual] |
Checks of two triangles are equal.
Implements vctl::MCEntity< MCTri >.
virtual std::string vctl::MCTri::ToString | ( | ) | const [inline, virtual] |
Returns text description of the triangle.
Implements vctl::MCEntity< MCTri >.
MCTri* vctl::MCTri::s[3] [protected] |
Pointers to triangles sharing the corresponding vertex.
MCVertex* vctl::MCTri::u[3] [protected] |
Pointers to all triangle vertices.