CTriangleMesh Class Reference

A class to deine a triangle mesh with some attributes. More...

#include <mia/mesh/triangularMesh.hh>

Inheritance diagram for CTriangleMesh:
[legend]
Collaboration diagram for CTriangleMesh:
[legend]

Public Types

enum  EData {
  ed_none = 0, ed_vertex = 1, ed_normal = 2, ed_color = 4,
  ed_scale = 8
}
 these are some flags to indicate, which data is actually available More...
 
typedef std::shared_ptr< CTriangleMeshPointer
 
typedef CTriangleMesh type
 

Public Member Functions

CTriangleMeshclone () const __attribute__((warn_unused_result))
 
CTriangleMesh clone_connectivity () const
 
const color_type & color_at (unsigned int i) const
 
 CTriangleMesh ()
 Standart constructor creates an empty mesh. More...
 
 CTriangleMesh (const CTriangleMesh &orig)
 
 CTriangleMesh (int n_triangles, int n_vertices)
 
 CTriangleMesh (PTrianglefield triangles, PVertexfield vertices, PNormalfield normals, PColorfield colors, PScalefield scales)
 
 CTriangleMesh (PTrianglefield triangles, PVertexfield vertices)
 
void evaluate_normals ()
 
int get_available_data () const
 
const void * get_color_pointer () const
 
const void * get_normal_pointer () const
 
const std::string & get_sourceformat () const
 
const void * get_triangle_pointer () const
 
const CTrianglefield & get_triangles () const
 
const void * get_vertex_pointer () const
 
const CVertexfield & get_vertices () const
 
const normal_type & normal_at (unsigned int i) const
 
const scale_type & scale_at (unsigned int i) const
 
void set_sourceformat (const std::string &fmt)
 
const triangle_type & triangle_at (unsigned int i) const
 
unsigned int triangle_size () const
 
const vertex_type & vertex_at (unsigned int i) const
 
unsigned int vertices_size () const
 
 ~CTriangleMesh ()
 Destructor - it releases all the data. More...
 
- Public Member Functions inherited from CIOData
const std::string & get_source_format () const
 
void set_source_format (const std::string &format)
 

Static Public Member Functions

static const std::string get_type_description ()
 

Static Public Attributes

static const char * data_descr
 

Detailed Description

A class to deine a triangle mesh with some attributes.

This class defines the representation of a triangle-mesh.

Definition at line 61 of file triangularMesh.hh.

Member Typedef Documentation

◆ Pointer

typedef std::shared_ptr<CTriangleMesh> CTriangleMesh::Pointer

Definition at line 71 of file triangularMesh.hh.

◆ type

Definition at line 68 of file triangularMesh.hh.

Member Enumeration Documentation

◆ EData

these are some flags to indicate, which data is actually available

Enumerator
ed_none 
ed_vertex 
ed_normal 
ed_color 
ed_scale 

Definition at line 74 of file triangularMesh.hh.

Constructor & Destructor Documentation

◆ CTriangleMesh() [1/5]

CTriangleMesh::CTriangleMesh ( )

Standart constructor creates an empty mesh.

◆ CTriangleMesh() [2/5]

CTriangleMesh::CTriangleMesh ( const CTriangleMesh orig)

copy constructor makes a shallow copy of the mesh, i.e. the storage for triangles, vertices, normals, textur-coordinates, colors and the deformation-scale is shared between original and copy

Parameters
origthe mesh to be copied

◆ CTriangleMesh() [3/5]

CTriangleMesh::CTriangleMesh ( int  n_triangles,
int  n_vertices 
)

contruct an mesh with uninitialized data

Parameters
n_trianglesnumber of triangles
n_verticesnumber of vertices

◆ CTriangleMesh() [4/5]

CTriangleMesh::CTriangleMesh ( PTrianglefield  triangles,
PVertexfield  vertices,
PNormalfield  normals,
PColorfield  colors,
PScalefield  scales 
)

creates a new mesh from given input data

Parameters
trianglesthe triangle data (required)
verticesthe vertex data (required)
normalsper vertex normals - can be NULL, in this case then the normals are calculated
colorsper vertex color
scales

◆ CTriangleMesh() [5/5]

CTriangleMesh::CTriangleMesh ( PTrianglefield  triangles,
PVertexfield  vertices 
)

creates a new mesh from given input data

Parameters
trianglesthe triangle data (required)
verticesthe vertex data (required)

◆ ~CTriangleMesh()

CTriangleMesh::~CTriangleMesh ( )

Destructor - it releases all the data.

Member Function Documentation

◆ clone()

CTriangleMesh* CTriangleMesh::clone ( ) const
Returns
a copy of this mesh

◆ clone_connectivity()

CTriangleMesh CTriangleMesh::clone_connectivity ( ) const
Returns
a mesh where the connectivity is copied, the vertices are allocated, but not set, and without normals and scale values

◆ color_at()

const color_type& CTriangleMesh::color_at ( unsigned int  i) const
Returns
the color at the given index i
Parameters
i

◆ evaluate_normals()

void CTriangleMesh::evaluate_normals ( )

Force the re-evaluation of the normals of the mesh. The normal at a vertex is evaluared as the area-weighted average of the normals of the triangles, the vertex is part of.

Referenced by colorize_mesh().

◆ get_available_data()

int CTriangleMesh::get_available_data ( ) const
Returns
a set of EData flags indicating which data is available

Referenced by colorize_mesh().

◆ get_color_pointer()

const void* CTriangleMesh::get_color_pointer ( ) const
Returns
a raw pointer to the colors

◆ get_normal_pointer()

const void* CTriangleMesh::get_normal_pointer ( ) const
Returns
a raw pointer to the normals

◆ get_sourceformat()

const std::string& CTriangleMesh::get_sourceformat ( ) const
inline
Returns
the format the mesh was given in the beginning

Definition at line 261 of file triangularMesh.hh.

◆ get_triangle_pointer()

const void* CTriangleMesh::get_triangle_pointer ( ) const
Returns
a raw pointer to the triangles

◆ get_triangles()

const CTrianglefield& CTriangleMesh::get_triangles ( ) const

◆ get_type_description()

static const std::string CTriangleMesh::get_type_description ( )
static
Returns
a type sescription name usefull for some plugin handling

◆ get_vertex_pointer()

const void* CTriangleMesh::get_vertex_pointer ( ) const
Returns
a raw pointer to the vertices

◆ get_vertices()

const CVertexfield& CTriangleMesh::get_vertices ( ) const

◆ normal_at()

const normal_type& CTriangleMesh::normal_at ( unsigned int  i) const
Returns
a const reference to the normal of the i-th vertex

◆ scale_at()

const scale_type& CTriangleMesh::scale_at ( unsigned int  i) const
Returns
a const reference to the scale at the i-th vertex

◆ set_sourceformat()

void CTriangleMesh::set_sourceformat ( const std::string &  fmt)
inline
Parameters
fmtset the save format of the mesh

Definition at line 266 of file triangularMesh.hh.

◆ triangle_at()

const triangle_type& CTriangleMesh::triangle_at ( unsigned int  i) const
Returns
a cost reference to the triangle at index i

◆ triangle_size()

unsigned int CTriangleMesh::triangle_size ( ) const
Returns
the number of triangles, the mesh consists of

◆ vertex_at()

const vertex_type& CTriangleMesh::vertex_at ( unsigned int  i) const
Returns
a const reference to the i-th vertex

◆ vertices_size()

unsigned int CTriangleMesh::vertices_size ( ) const
Returns
the number of vertices the mesh consists of

Field Documentation

◆ data_descr

const char* CTriangleMesh::data_descr
static

The type description provides information about the data type that is used by the plug-in system

Definition at line 66 of file triangularMesh.hh.


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