cpe_mesh::mesh Class Reference

basic mesh class More...

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

List of all members.

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)
meshset_vertex (const unsigned int &k_vertex, const mesh_conv::MC_v3d &new_vertex)
 set a 3D vertex (to do)
meshset_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 meshsave_off_file (const std::string &filename) const
 save mesh as off file
meshscale_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)

Detailed Description

basic mesh class


Constructor & Destructor Documentation

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.


Member Function Documentation

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

std::vector< double > cpe_mesh::mesh::normal_polygon (  )  const

compute per polygon normal

References connectivity, triangle_number(), and vertex.

Referenced by normal_vertex().

Here is the call graph for this function:

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().

Here is the call graph for this function:

std::map< int, std::list< int > > cpe_mesh::mesh::ring (  )  const

build one ring

References connectivity, and triangle_number().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

mesh & cpe_mesh::mesh::set_connectivity ( const unsigned int &  k_polygon,
const std::vector< int > &  new_triangle 
)

set connectivity (to do)

References assert_connectivity().

Here is the call graph for this function:

mesh & cpe_mesh::mesh::set_vertex ( const unsigned int &  k_vertex,
const mesh_conv::MC_v3d new_vertex 
)

set a 3D vertex (to do)

References assert_vertex().

Here is the call graph for this function:

std::map< int, std::list< int > > cpe_mesh::mesh::star (  )  const

build one star

References connectivity, and triangle_number().

Referenced by normal_vertex().

Here is the call graph for this function:

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

number of vertices

References vertex.

Referenced by normal_vertex(), and scale_unity().


Member Data Documentation

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]

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

Generated on Wed Nov 11 17:13:45 2009 by  doxygen 1.6.1