My Project
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.
 CTriangleMesh (const CTriangleMesh &orig)
 CTriangleMesh (int n_triangles, int n_vertices)
 CTriangleMesh (PTrianglefield triangles, PVertexfield vertices)
 CTriangleMesh (PTrianglefield triangles, PVertexfield vertices, PNormalfield normals, PColorfield colors, PScalefield scales)
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.
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 72 of file triangularMesh.hh.

◆ type

Definition at line 69 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 75 of file triangularMesh.hh.

Constructor & Destructor Documentation

◆ CTriangleMesh() [1/5]

CTriangleMesh::CTriangleMesh ( )

Standart constructor creates an empty mesh.

Referenced by clone(), clone_connectivity(), CTriangleMesh(), and ~CTriangleMesh().

◆ 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

References CTriangleMesh().

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

References CTriangleMesh().

Member Function Documentation

◆ clone()

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

References CTriangleMesh().

◆ 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

References clone_connectivity(), and CTriangleMesh().

Referenced by clone_connectivity().

◆ color_at()

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

References color_at().

Referenced by color_at().

◆ 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

References get_available_data().

Referenced by colorize_mesh(), and get_available_data().

◆ get_color_pointer()

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

References get_color_pointer().

Referenced by get_color_pointer().

◆ get_normal_pointer()

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

References get_normal_pointer().

Referenced by get_normal_pointer().

◆ get_sourceformat()

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

Definition at line 263 of file triangularMesh.hh.

References get_sourceformat().

Referenced by get_sourceformat().

◆ get_triangle_pointer()

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

References get_triangle_pointer().

Referenced by get_triangle_pointer().

◆ get_triangles()

const CTrianglefield & CTriangleMesh::get_triangles ( ) const

References get_triangles().

Referenced by get_triangles().

◆ get_type_description()

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

References get_type_description().

Referenced by get_type_description().

◆ get_vertex_pointer()

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

References get_vertex_pointer().

Referenced by get_vertex_pointer().

◆ get_vertices()

const CVertexfield & CTriangleMesh::get_vertices ( ) const

References get_vertices().

Referenced by get_vertices().

◆ normal_at()

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

References normal_at().

Referenced by normal_at().

◆ scale_at()

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

References scale_at().

Referenced by scale_at().

◆ set_sourceformat()

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

Definition at line 269 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

References triangle_at().

Referenced by triangle_at().

◆ triangle_size()

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

References triangle_size().

Referenced by triangle_size().

◆ vertex_at()

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

References vertex_at().

Referenced by vertex_at().

◆ vertices_size()

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

References vertices_size().

Referenced by vertices_size().

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 67 of file triangularMesh.hh.


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