Public Member Functions | |
mesh () | |
empty constructor | |
mesh (const std::pair< std::vector< double >, std::vector< int > > &input) | |
constructor from std::pair <vertex,connectivity> | |
mesh_conv::MC_v3d | get_vertex (const unsigned int &k_vertex) const |
get vertex k (to do) | |
std::vector< int > | get_connectivity (const unsigned int &k_polygon) const |
get connectivity polygon (to do) | |
mesh & | set_vertex (const unsigned int &k_vertex, const mesh_conv::MC_v3d &new_vertex) |
set a 3D vertex (to do) | |
mesh & | set_connectivity (const unsigned int &k_polygon, const std::vector< int > &new_triangle) |
set connectivity (to do) | |
unsigned int | vertex_number () const |
number of vertices | |
unsigned int | triangle_number () const |
number of triangles | |
std::map< int, std::list< int > > | ring () const |
build one ring | |
std::map< int, std::list< int > > | star () const |
build one star | |
std::vector< double > | normal_vertex () const |
compute per vertex normal | |
std::vector< double > | normal_polygon () const |
compute per polygon normal | |
const std::vector< double > & | get_vertex () const |
get internal vertex | |
std::vector< double > & | get_vertex () |
get internal vertex | |
const std::vector< int > & | get_connectivity () const |
get internal connectivity | |
std::vector< int > & | get_connectivity () |
get internal connectivity | |
void | assert_vertex (const unsigned int &k_vertex) const |
check vertex index are within the bounds | |
void | assert_connectivity (const unsigned int &k_connectivity) const |
check polygon index are within the bounds | |
const mesh & | save_off_file (const std::string &filename) const |
save mesh as off file | |
mesh & | scale_unity () |
scale and translate the mesh to fit into the unit cube | |
Static Public Member Functions | |
static mesh | load_off_file (const std::string &filename) |
load off file | |
Private Attributes | |
std::vector< double > | vertex |
vertex vector (size=3xN_vertex) | |
std::vector< int > | connectivity |
connectivity vector (only triangles) (size=3xN_poly) |
basic mesh class
cpe_mesh::mesh::mesh | ( | ) |
empty constructor
Referenced by load_off_file().
cpe_mesh::mesh::mesh | ( | const std::pair< std::vector< double >, std::vector< int > > & | input | ) |
constructor from std::pair <vertex,connectivity>
References connectivity, and vertex.
void cpe_mesh::mesh::assert_connectivity | ( | const unsigned int & | k_connectivity | ) | const [inline] |
check polygon index are within the bounds
References connectivity.
Referenced by get_connectivity(), and set_connectivity().
void cpe_mesh::mesh::assert_vertex | ( | const unsigned int & | k_vertex | ) | const [inline] |
check vertex index are within the bounds
References vertex.
Referenced by get_vertex(), and set_vertex().
std::vector< int > & cpe_mesh::mesh::get_connectivity | ( | ) |
get internal connectivity
References connectivity.
const std::vector< int > & cpe_mesh::mesh::get_connectivity | ( | ) | const |
get internal connectivity
References connectivity.
std::vector< int > cpe_mesh::mesh::get_connectivity | ( | const unsigned int & | k_polygon | ) | const |
get connectivity polygon (to do)
References assert_connectivity().
Referenced by draw_scene(), and draw_sphere().
std::vector< double > & cpe_mesh::mesh::get_vertex | ( | ) |
get internal vertex
References vertex.
const std::vector< double > & cpe_mesh::mesh::get_vertex | ( | ) | const |
get internal vertex
References vertex.
mesh_conv::MC_v3d cpe_mesh::mesh::get_vertex | ( | const unsigned int & | k_vertex | ) | const |
get vertex k (to do)
References assert_vertex().
Referenced by draw_scene(), and draw_sphere().
mesh cpe_mesh::mesh::load_off_file | ( | const std::string & | filename | ) | [static] |
load off file
References mesh(), and mesh_conv::MC_io_off::read_off_file().
std::vector< double > cpe_mesh::mesh::normal_polygon | ( | ) | const |
compute per polygon normal
References connectivity, triangle_number(), and vertex.
Referenced by normal_vertex().
std::vector< double > cpe_mesh::mesh::normal_vertex | ( | ) | const |
compute per vertex normal
References normal_polygon(), mesh_conv::MC_v3d::normalized(), star(), vertex, and vertex_number().
Referenced by load_model().
std::map< int, std::list< int > > cpe_mesh::mesh::ring | ( | ) | const |
build one ring
References connectivity, and triangle_number().
const mesh & cpe_mesh::mesh::save_off_file | ( | const std::string & | filename | ) | const |
save mesh as off file
References connectivity, vertex, and mesh_conv::MC_io_off::write_off_file().
mesh & cpe_mesh::mesh::scale_unity | ( | ) |
scale and translate the mesh to fit into the unit cube
References vertex, and vertex_number().
Referenced by load_model().
mesh & cpe_mesh::mesh::set_connectivity | ( | const unsigned int & | k_polygon, | |
const std::vector< int > & | new_triangle | |||
) |
set connectivity (to do)
References assert_connectivity().
mesh & cpe_mesh::mesh::set_vertex | ( | const unsigned int & | k_vertex, | |
const mesh_conv::MC_v3d & | new_vertex | |||
) |
std::map< int, std::list< int > > cpe_mesh::mesh::star | ( | ) | const |
build one star
References connectivity, and triangle_number().
Referenced by normal_vertex().
unsigned int cpe_mesh::mesh::triangle_number | ( | ) | const |
number of triangles
References connectivity.
Referenced by draw_scene(), draw_sphere(), normal_polygon(), ring(), and star().
unsigned int cpe_mesh::mesh::vertex_number | ( | ) | const |
std::vector<int> cpe_mesh::mesh::connectivity [private] |
connectivity vector (only triangles) (size=3xN_poly)
Referenced by assert_connectivity(), get_connectivity(), mesh(), normal_polygon(), ring(), save_off_file(), star(), and triangle_number().
std::vector<double> cpe_mesh::mesh::vertex [private] |
vertex vector (size=3xN_vertex)
Referenced by assert_vertex(), get_vertex(), mesh(), normal_polygon(), normal_vertex(), save_off_file(), scale_unity(), and vertex_number().