VectorEntity  1.1.0
Medical Data Segmentation Toolkit
Public Member Functions | Protected Types | Protected Attributes
vctl::MCTri Class Reference

Triangle in 3D space, component of a polygonal mesh. More...

#include <mctri.h>

Inheritance diagram for vctl::MCTri:
Inheritance graph
[legend]

List of all members.

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.
MCEdgeGetEdge (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.
MCTriGetNeighbour (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.
MCVertexGetRestVertex (MCVertex *_u0, MCVertex *_u1)
 Returns a remaining vertex, or NULL.
MCVertexGetVertex (int index)
 Return pointer to a specified vertex.
MCTriGetVertexTri (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< MCTritBase
 Base class.

Protected Attributes

MCTris [3]
 Pointers to triangles sharing the corresponding vertex.
MCVertexu [3]
 Pointers to all triangle vertices.

Detailed Description

Triangle in 3D space, component of a polygonal mesh.


Member Typedef Documentation

typedef MCEntity<MCTri> vctl::MCTri::tBase [protected]

Base class.


Constructor & Destructor Documentation

vctl::MCTri::MCTri ( ) [inline]

Default constructor.

  • Initializes all pointers to NULL!
vctl::MCTri::MCTri ( const MCTri _tri) [inline]

Copy constructor.

  • Initializes only pointers to triangle vertices.
vctl::MCTri::MCTri ( MCTri _tri) [inline]

Constructor.

  • Initializes only pointers to triangle vertices.
vctl::MCTri::MCTri ( MCVertex _u0,
MCVertex _u1,
MCVertex _u2 
) [inline]

Constructor.

  • Initializes only pointers to triangle vertices.
vctl::MCTri::MCTri ( MCVertex _u[3]) [inline]

Constructor.

  • Initializes only pointers to triangle vertices.
virtual vctl::MCTri::~MCTri ( ) [inline, virtual]

Empty destructor.


Member Function Documentation

void vctl::MCTri::ChangeVertex ( MCVertex old_uzel,
MCVertex new_uzel 
) [inline]

Exchanges one of the triangle vertices.

  • This method doesn't changes registration of tringles in vertices. You must do the registration on your own.

Compares orientation of two triangles.

  • 1 - same orientation of triangles.
  • 0 - perpendicular triangles.
  • -1 - reverse orientation.

Deregistration of triangle from vertices.

template<class S >
void vctl::MCTri::DeserializeEntity ( mds::mod::CChannelSerializer< S > &  Reader,
std::vector< MCVertex * > &  index_array 
) [inline]

Deserializes the triangle.

  • An array of vertices must be loaded previously.

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.

  • Not yet implemented!
    Todo:
    Doplnit implementaci generovani hash kodu.

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.

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.

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.

  • NULL on failure.
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.

Changes orientation of the triangle.

int vctl::MCTri::IsVertex ( MCVertex test_uzel) const [inline]

Checks if a given vertex belongs to the triangle.

Returns:
index of the vertex within the triangle, or -1 otherwise.
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.

  • An array of vertices must be loaded previously.
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.

  • An index must be assigned to each vertex.
template<class S >
void vctl::MCTri::SerializeEntity ( mds::mod::CChannelSerializer< S > &  Writer) [inline]

Serializes the triangle.

  • An index must be assigned to each vertex.

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 >.


Member Data Documentation

MCTri* vctl::MCTri::s[3] [protected]

Pointers to triangles sharing the corresponding vertex.

MCVertex* vctl::MCTri::u[3] [protected]

Pointers to all triangle vertices.


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