cpe::mesh Class Reference

Container class for a generic mesh with normal, color, ... More...

Collaboration diagram for cpe::mesh:
Collaboration graph
[legend]

List of all members.

Public Member Functions

const std::vector< v3 > & get_vertices () const
 return internal vertices vector
const std::vector< v3 > & get_normal () const
 return internal normal vector
const std::vector< color > & get_color () const
 return internal color vector
const std::vector< int > & get_connectivity () const
 return internal connectivity vector
std::vector< v3 > & get_vertices ()
 return internal vertices vector
std::vector< v3 > & get_normal ()
 return internal normal vector
std::vector< color > & get_color ()
 return internal color vector
std::vector< int > & get_connectivity ()
 return internal connectivity vector
void fill_color (const color &c)
 fill mesh with constant color
void fill_color_xyz ()
 fill mesh with color depending of (x,y,z)-coordinates
void fill_color_normal ()
 fill mesh with color depending of normal orientation
void compute_normal ()
 Compute a per-vertex normal and fill the internal vector.
meshoperator+= (const v3 &x)
 internal translation
meshoperator-= (const v3 &x)
 internal translation
meshoperator*= (const double &s)
 uniform scaling
void scale (const double &sx, const double &sy, const double &sz)
 scale the mesh with anisotropical values
void auto_scale (const double &scale=1.0)
 Set vertices to fit in scalex[-1,1]x[-1,1].
void load_off (const std::string &filename)
 load a off file

Private Attributes

std::vector< v3v_vertices
 internal vertices storage
std::vector< v3v_normal
 internal normal storage
std::vector< colorv_color
 internal color storage
std::vector< int > v_connectivity
 internal connectivity storage

Friends

mesh operator+ (const v3 &x, const mesh &m)
 translation
mesh operator+ (const mesh &m, const v3 &x)
 translation
mesh operator- (const mesh &m, const v3 &x)
 translation
mesh operator* (const double &s, const mesh &m)
 uniform scaling
mesh operator* (const mesh &m, const double &s)
 uniform scaling

Detailed Description

Container class for a generic mesh with normal, color, ...


Member Function Documentation

void cpe::mesh::auto_scale ( const double &  scale = 1.0  ) 

Set vertices to fit in scalex[-1,1]x[-1,1].

z-coordinate is set to start at -1 Auto fit the unit square ((-1,-1,1),(-1,1,1),(1,-1,1),(1,1,1))

References v_vertices, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().

Referenced by main().

Here is the call graph for this function:

void cpe::mesh::compute_normal (  ) 

Compute a per-vertex normal and fill the internal vector.

References cpe::v3::normalized(), v_connectivity, v_normal, and v_vertices.

Referenced by main().

Here is the call graph for this function:

void cpe::mesh::fill_color ( const color c  ) 

fill mesh with constant color

References v_color, and v_vertices.

Referenced by main().

void cpe::mesh::fill_color_normal (  ) 

fill mesh with color depending of normal orientation

References v_color, v_normal, v_vertices, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().

Here is the call graph for this function:

void cpe::mesh::fill_color_xyz (  ) 

fill mesh with color depending of (x,y,z)-coordinates

References v_color, v_vertices, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().

Referenced by main().

Here is the call graph for this function:

std::vector< color > & cpe::mesh::get_color (  ) 

return internal color vector

References v_color.

const std::vector< color > & cpe::mesh::get_color (  )  const

return internal color vector

References v_color.

Referenced by cpe::render_engine::render_mesh().

std::vector< int > & cpe::mesh::get_connectivity (  ) 

return internal connectivity vector

References v_connectivity.

const std::vector< int > & cpe::mesh::get_connectivity (  )  const

return internal connectivity vector

References v_connectivity.

Referenced by cpe::render_engine::render_mesh().

std::vector< v3 > & cpe::mesh::get_normal (  ) 

return internal normal vector

References v_normal.

const std::vector< v3 > & cpe::mesh::get_normal (  )  const

return internal normal vector

References v_normal.

Referenced by cpe::render_engine::render_mesh().

std::vector< v3 > & cpe::mesh::get_vertices (  ) 

return internal vertices vector

References v_vertices.

const std::vector< v3 > & cpe::mesh::get_vertices (  )  const

return internal vertices vector

References v_vertices.

Referenced by cpe::render_engine::render_mesh().

void cpe::mesh::load_off ( const std::string &  filename  ) 

load a off file

References v_color, v_connectivity, v_normal, v_vertices, cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().

Referenced by main().

Here is the call graph for this function:

mesh & cpe::mesh::operator*= ( const double &  s  ) 

uniform scaling

References v_vertices.

mesh & cpe::mesh::operator+= ( const v3 x  ) 

internal translation

References v_vertices.

mesh & cpe::mesh::operator-= ( const v3 x  ) 

internal translation

References v_vertices.

void cpe::mesh::scale ( const double &  sx,
const double &  sy,
const double &  sz 
)

scale the mesh with anisotropical values

References v_vertices.


Friends And Related Function Documentation

mesh operator* ( const mesh m,
const double &  s 
) [friend]

uniform scaling

mesh operator* ( const double &  s,
const mesh m 
) [friend]

uniform scaling

mesh operator+ ( const mesh m,
const v3 x 
) [friend]

translation

mesh operator+ ( const v3 x,
const mesh m 
) [friend]

translation

mesh operator- ( const mesh m,
const v3 x 
) [friend]

translation


Member Data Documentation

std::vector<color> cpe::mesh::v_color [private]

internal color storage

Referenced by fill_color(), fill_color_normal(), fill_color_xyz(), get_color(), and load_off().

std::vector<int> cpe::mesh::v_connectivity [private]

internal connectivity storage

Referenced by compute_normal(), get_connectivity(), and load_off().

std::vector<v3> cpe::mesh::v_normal [private]

internal normal storage

Referenced by compute_normal(), fill_color_normal(), get_normal(), and load_off().

std::vector<v3> cpe::mesh::v_vertices [private]

The documentation for this class was generated from the following files:
Generated on Mon Apr 18 20:43:35 2011 by  doxygen 1.6.3