Helper class for OpenGL calls. More...
Static Public Member Functions | |
static void | draw (const mesh &m, const std::vector< double > &normal) |
draw mesh with given normals | |
static void | draw (const mesh &m) |
draw mesh (without normal information: only draw edges) | |
static void | draw_normals (const mesh &m, const std::vector< double > &normal, const double &L_scaling=1.0) |
draw normal associated to a given mesh | |
static void | generate_texture (const unsigned int &id_texture, const std::string &filename) |
generate a texture identifiant from a data vector | |
static void | draw (const spring_mesh &m) |
draw spring mass mesh | |
Static Private Member Functions | |
static void | draw_edges (const mesh &m) |
draw mesh edges only | |
static void | draw_per_polygon_normal (const mesh &m, const std::vector< double > &normal) |
draw mesh with polygon per triangle | |
static void | draw_per_vertex_normal (const mesh &m, const std::vector< double > &normal) |
draw mesh with polygon per vertex |
Helper class for OpenGL calls.
void cpe::opengl_drawer::draw | ( | const spring_mesh & | m | ) | [static] |
draw spring mass mesh
References cpe::spring_mesh::get_vertex_storage(), and cpe::spring_mesh::size().
void cpe::opengl_drawer::draw | ( | const mesh & | m | ) | [static] |
draw mesh (without normal information: only draw edges)
References draw_edges().
void cpe::opengl_drawer::draw | ( | const mesh & | m, | |
const std::vector< double > & | normal | |||
) | [static] |
draw mesh with given normals
mesh | m: the mesh | |
std::vector<double> | normal: the normal of the meshes Normal size must be either vertex_number():smooth shading or triangle_number():flat shading |
References draw_per_polygon_normal(), draw_per_vertex_normal(), cpe::mesh::triangle_number(), and cpe::mesh::vertex_number().
Referenced by draw_scene().
void cpe::opengl_drawer::draw_edges | ( | const mesh & | m | ) | [static, private] |
draw mesh edges only
References cpe::mesh::get_connectivity(), cpe::mesh::get_vertex(), and cpe::mesh::triangle_number().
Referenced by draw().
void cpe::opengl_drawer::draw_normals | ( | const mesh & | m, | |
const std::vector< double > & | normal, | |||
const double & | L_scaling = 1.0 | |||
) | [static] |
draw normal associated to a given mesh
mesh | m: the mesh | |
std::vector<double> | normal: the per_face or per_vertex normal | |
L_scaling,: | scale the normal size |
References cpe::mesh::get_vertex(), cpe::mesh::triangle_number(), cpe::mesh::vertex_number(), cpe::v3::x(), cpe::v3::y(), and cpe::v3::z().
void cpe::opengl_drawer::draw_per_polygon_normal | ( | const mesh & | m, | |
const std::vector< double > & | normal | |||
) | [static, private] |
draw mesh with polygon per triangle
References cpe::mesh::get_connectivity(), cpe::mesh::get_texture(), cpe::mesh::get_vertex(), cpe::mesh::triangle_number(), and cpe::mesh::vertex_number().
Referenced by draw().
void cpe::opengl_drawer::draw_per_vertex_normal | ( | const mesh & | m, | |
const std::vector< double > & | normal | |||
) | [static, private] |
draw mesh with polygon per vertex
References cpe::mesh::get_connectivity(), cpe::mesh::get_texture(), cpe::mesh::get_vertex(), cpe::mesh::triangle_number(), and cpe::mesh::vertex_number().
Referenced by draw().
void cpe::opengl_drawer::generate_texture | ( | const unsigned int & | id_texture, | |
const std::string & | filename | |||
) | [static] |
generate a texture identifiant from a data vector
References cpe::texture::get_data(), cpe::texture::get_Nx(), cpe::texture::get_Ny(), and cpe::texture::load_picture().