Container class for a generic mesh with normal, color, texture, ... More...
Collaboration diagram for cpe::mesh:Public Member Functions | |
| const vec3 & | vertex (const unsigned int &index) const |
| Accessor to the vertex value. More... | |
| vec3 & | vertex (const unsigned int &index) |
| Accessor to the vertex value. More... | |
| const vec3 & | vertex_of_polygon (const unsigned int &index_polygon, const unsigned int &index_vertex) const |
| Accessor to the vertex value. More... | |
| vec3 & | vertex_of_polygon (const unsigned int &index_polygon, const unsigned int &index_vertex) |
| Accessor to the vertex value. More... | |
| const vec3 & | normal (const unsigned int &index) const |
| Accessor to the normal value. More... | |
| vec3 & | normal (const unsigned int &index) |
| Accessor to the normal value. More... | |
| const vec3 & | color (const unsigned int &index) const |
| Accessor to the color value. More... | |
| vec3 & | color (const unsigned int &index) |
| Accessor to the color value. More... | |
| const int & | connectivity (const unsigned int &index) const |
| Accessor to the connectivity value. More... | |
| int & | connectivity (const unsigned int &index) |
| Accessor to the connectivity value. More... | |
| const vec2 & | texture (const unsigned int &index) const |
| Accessor to the uv-texture value. More... | |
| vec2 & | texture (const unsigned int &index) |
| Accessor to the uv-texture value. More... | |
| const std::vector< vec3 > & | get_vertices () const |
| return internal vertices vector More... | |
| const std::vector< vec3 > & | get_normal () const |
| return internal normal vector More... | |
| const std::vector< vec3 > & | get_color () const |
| return internal color vector More... | |
| const std::vector< int > & | get_connectivity () const |
| return internal connectivity vector More... | |
| const std::vector< vec2 > & | get_texture () const |
| return internal uv texture vector More... | |
| std::vector< vec3 > & | get_vertices () |
| return internal vertices vector More... | |
| std::vector< vec3 > & | get_normal () |
| return internal normal vector More... | |
| std::vector< vec3 > & | get_color () |
| return internal color vector More... | |
| std::vector< int > & | get_connectivity () |
| return internal connectivity vector More... | |
| std::vector< vec2 > & | get_texture () |
| return internal uv texture vector More... | |
| void | add_vertex (const vec3 &vertex_to_add) |
| Add a vertex to the mesh. More... | |
| void | add_texture (const vec2 &texture_to_add) |
| Add a texture to the mesh. More... | |
| void | add_triangle (const int u0, const int u1, const int u2) |
| Add a triangle to the mesh. More... | |
| unsigned int | number_of_triangle () const |
| get the number of triangle More... | |
| unsigned int | number_of_vertices () const |
| get the number of vertices More... | |
| void | fill_color (const vec3 &c) |
| fill mesh with constant color More... | |
| void | fill_color_xyz () |
| fill mesh with color depending of (x,y,z)-coordinates More... | |
| void | fill_color_normal () |
| fill mesh with color depending of normal orientation More... | |
| void | compute_normal () |
| Compute a per-vertex normal and fill the internal vector. More... | |
| std::vector< vec3 > | get_normal_per_vertex () const |
| get the vector per vertex More... | |
| std::vector< vec3 > | get_normal_per_polygon () const |
| get the vector per polygon More... | |
| mesh & | operator+= (const vec3 &x) |
| internal translation More... | |
| mesh & | operator-= (const vec3 &x) |
| internal translation More... | |
| mesh & | operator*= (const double &s) |
| uniform scaling More... | |
| void | scale (const double &sx, const double &sy, const double &sz) |
| scale the mesh with anisotropical values More... | |
| void | auto_scale (const double &scale=1.0) |
| Set vertices to fit in scalex[-1,1]x[-1,1]. More... | |
| void | apply (const cpe::matrix3 R) |
| Apply matrix to every vertices. More... | |
| void | load_file (const std::string &filename) |
| load a off file More... | |
Private Attributes | |
| std::vector< vec3 > | v_vertices |
| internal vertices storage More... | |
| std::vector< vec3 > | v_normal |
| internal normal storage More... | |
| std::vector< vec3 > | v_color |
| internal color storage More... | |
| std::vector< vec2 > | v_texture |
| internal texture coordinate storage More... | |
| std::vector< int > | v_connectivity |
| internal connectivity storage More... | |
Friends | |
| mesh | operator+ (const vec3 &x, const mesh &m) |
| translation More... | |
| mesh | operator+ (const mesh &m, const vec3 &x) |
| translation More... | |
| mesh | operator- (const mesh &m, const vec3 &x) |
| translation More... | |
| mesh | operator* (const double &s, const mesh &m) |
| uniform scaling More... | |
| mesh | operator* (const mesh &m, const double &s) |
| uniform scaling More... | |
Container class for a generic mesh with normal, color, texture, ...
| void cpe::mesh::add_texture | ( | const vec2 & | texture_to_add | ) |
| void cpe::mesh::add_triangle | ( | const int | u0, |
| const int | u1, | ||
| const int | u2 | ||
| ) |
| void cpe::mesh::add_vertex | ( | const vec3 & | vertex_to_add | ) |
| void cpe::mesh::apply | ( | const cpe::matrix3 | R | ) |
Apply matrix to every vertices.
References v_vertices.
| 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::vec3::x(), cpe::vec3::y(), and cpe::vec3::z().
Here is the call graph for this function:| const vec3 & cpe::mesh::color | ( | const unsigned int & | index | ) | const |
Accessor to the color value.
References MACRO_EXCEPTION_PARAMETER, and v_color.
| vec3 & cpe::mesh::color | ( | const unsigned int & | index | ) |
Accessor to the color value.
References MACRO_EXCEPTION_PARAMETER, and v_color.
| void cpe::mesh::compute_normal | ( | ) |
Compute a per-vertex normal and fill the internal vector.
References get_normal_per_vertex(), and v_normal.
Here is the call graph for this function:| const int & cpe::mesh::connectivity | ( | const unsigned int & | index | ) | const |
Accessor to the connectivity value.
References MACRO_EXCEPTION_PARAMETER, v_color, and v_connectivity.
| int & cpe::mesh::connectivity | ( | const unsigned int & | index | ) |
Accessor to the connectivity value.
References MACRO_EXCEPTION_PARAMETER, v_color, and v_connectivity.
| void cpe::mesh::fill_color | ( | const vec3 & | c | ) |
fill mesh with constant color
References v_color, and v_vertices.
| void cpe::mesh::fill_color_normal | ( | ) |
fill mesh with color depending of normal orientation
References v_color, v_normal, v_vertices, cpe::vec3::x(), cpe::vec3::y(), and cpe::vec3::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::vec3::x(), cpe::vec3::y(), and cpe::vec3::z().
Here is the call graph for this function:| const std::vector< vec3 > & cpe::mesh::get_color | ( | ) | const |
| const std::vector< int > & cpe::mesh::get_connectivity | ( | ) | const |
return internal connectivity vector
References v_connectivity.
Referenced by cpe::opengl_drawer::draw(), and cpe::mesh_io::load_off_file().
| std::vector< int > & cpe::mesh::get_connectivity | ( | ) |
return internal connectivity vector
References v_connectivity.
| const std::vector< vec3 > & cpe::mesh::get_normal | ( | ) | const |
| std::vector< vec3 > cpe::mesh::get_normal_per_polygon | ( | ) | const |
get the vector per polygon
References v_connectivity, and v_vertices.
Referenced by get_normal_per_vertex().
| std::vector< vec3 > cpe::mesh::get_normal_per_vertex | ( | ) | const |
get the vector per vertex
References get_normal_per_polygon(), cpe::vec3::normalized(), v_connectivity, and v_vertices.
Referenced by compute_normal().
Here is the call graph for this function:| const std::vector< vec2 > & cpe::mesh::get_texture | ( | ) | const |
| std::vector< vec2 > & cpe::mesh::get_texture | ( | ) |
return internal uv texture vector
References v_texture.
| const std::vector< vec3 > & cpe::mesh::get_vertices | ( | ) | const |
return internal vertices vector
References v_vertices.
Referenced by cpe::opengl_drawer::draw(), and cpe::mesh_io::load_off_file().
| std::vector< vec3 > & cpe::mesh::get_vertices | ( | ) |
return internal vertices vector
References v_vertices.
| void cpe::mesh::load_file | ( | const std::string & | filename | ) |
load a off file
References cpe::mesh_io::load_obj_file(), cpe::mesh_io::load_off_file(), and MACRO_EXCEPTION_PARAMETER.
Here is the call graph for this function:| const vec3 & cpe::mesh::normal | ( | const unsigned int & | index | ) | const |
Accessor to the normal value.
References MACRO_EXCEPTION_PARAMETER, and v_normal.
| vec3 & cpe::mesh::normal | ( | const unsigned int & | index | ) |
Accessor to the normal value.
References MACRO_EXCEPTION_PARAMETER, and v_normal.
| unsigned int cpe::mesh::number_of_triangle | ( | ) | const |
| unsigned int cpe::mesh::number_of_vertices | ( | ) | const |
get the number of vertices
References v_vertices.
| mesh & cpe::mesh::operator*= | ( | const double & | s | ) |
uniform scaling
References v_vertices.
internal translation
References v_vertices.
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.
| const vec2 & cpe::mesh::texture | ( | const unsigned int & | index | ) | const |
Accessor to the uv-texture value.
References MACRO_EXCEPTION_PARAMETER, and v_texture.
| vec2 & cpe::mesh::texture | ( | const unsigned int & | index | ) |
Accessor to the uv-texture value.
References MACRO_EXCEPTION_PARAMETER, and v_texture.
| const vec3 & cpe::mesh::vertex | ( | const unsigned int & | index | ) | const |
Accessor to the vertex value.
References MACRO_EXCEPTION_PARAMETER, and v_vertices.
| vec3 & cpe::mesh::vertex | ( | const unsigned int & | index | ) |
Accessor to the vertex value.
References MACRO_EXCEPTION_PARAMETER, and v_vertices.
| const vec3 & cpe::mesh::vertex_of_polygon | ( | const unsigned int & | index_polygon, |
| const unsigned int & | index_vertex | ||
| ) | const |
Accessor to the vertex value.
References MACRO_EXCEPTION_PARAMETER, v_connectivity, and v_vertices.
| vec3 & cpe::mesh::vertex_of_polygon | ( | const unsigned int & | index_polygon, |
| const unsigned int & | index_vertex | ||
| ) |
Accessor to the vertex value.
References MACRO_EXCEPTION_PARAMETER, v_connectivity, and v_vertices.
|
private |
internal color storage
Referenced by color(), connectivity(), fill_color(), fill_color_normal(), fill_color_xyz(), and get_color().
|
private |
internal connectivity storage
Referenced by add_triangle(), connectivity(), get_connectivity(), get_normal_per_polygon(), get_normal_per_vertex(), number_of_triangle(), and vertex_of_polygon().
|
private |
internal normal storage
Referenced by compute_normal(), fill_color_normal(), get_normal(), and normal().
|
private |
internal texture coordinate storage
Referenced by add_texture(), get_texture(), and texture().
|
private |
internal vertices storage
Referenced by add_vertex(), apply(), auto_scale(), fill_color(), fill_color_normal(), fill_color_xyz(), get_normal_per_polygon(), get_normal_per_vertex(), get_vertices(), number_of_vertices(), operator*=(), operator+=(), operator-=(), scale(), vertex(), and vertex_of_polygon().