|
cgv
|
Public Types | |
| typedef T | coord_type |
| type of coordinates | |
| typedef cgv::math::fvec< T, 2 > | vec2_type |
| type used to store texture coordinates | |
| typedef cgv::math::fvec< T, 3 > | vec3_type |
| type used to store positions and normal vectors | |
| typedef illum::obj_material::color_type | color_type |
| type used for rgba colors | |
| typedef simple_mesh< T >::idx_type | idx_type |
Public Types inherited from cgv::media::mesh::obj_reader_generic< T > | |
| typedef T | coord_type |
| type of coordinates | |
| typedef cgv::math::fvec< T, 2 > | vec2_type |
| type used to store texture coordinates | |
| typedef cgv::math::fvec< T, 3 > | vec3_type |
| type used to store positions and normal vectors | |
Public Types inherited from cgv::media::mesh::obj_reader_base | |
| typedef illum::obj_material::color_type | color_type |
| type used for rgba colors | |
Public Member Functions | |
| simple_mesh_obj_reader (simple_mesh< T > &_mesh) | |
| void | process_vertex (const vec3_type &p) |
| overide this function to process a vertex | |
| void | process_texcoord (const vec2_type &t) |
| overide this function to process a texcoord | |
| void | process_color (const color_type &c) |
| overide this function to process a color (this called for vc prefixes which is is not in the standard but for example used in pobj-files) | |
| void | process_normal (const vec3_type &n) |
| overide this function to process a normal | |
| void | process_face (unsigned vcount, int *vertices, int *texcoords, int *normals) |
| overide this function to process a face, the indices start with 0 | |
| void | process_group (const std::string &name, const std::string ¶meters) |
| overide this function to process a group given by name and parameter string | |
| void | process_material (const cgv::media::illum::obj_material &mtl, unsigned idx) |
| process a material definition. If a material with a certain name is overwritten, it will receive the same index | |
Public Member Functions inherited from cgv::media::mesh::obj_reader_generic< T > | |
| obj_reader_generic () | |
| default constructor | |
Public Member Functions inherited from cgv::media::mesh::obj_reader_base | |
| virtual bool | parse_obj (const std::string &content, const std::string path_name="") |
| parse the content of an obj file already read to memory, where path_name is used to find material files | |
| virtual bool | read_obj (const std::string &file_name) |
| read an obj file | |
| virtual bool | read_mtl (const std::string &file_name) |
| read a material file | |
| virtual void | clear () |
| clear the reader such that a new file can be read | |
Protected Attributes | |
| simple_mesh< T > & | mesh |
Protected Attributes inherited from cgv::media::mesh::obj_reader_base | |
| unsigned | group_index |
| keep track of the current group | |
| unsigned | nr_groups |
| number of groups | |
| unsigned | material_index |
| keep track of current material index | |
| unsigned | nr_materials |
| number of materials | |
| std::map< std::string, unsigned > | material_index_lut |
| mapping from material names to material indices | |
| int | minus |
| unsigned | nr_normals |
| unsigned | nr_texcoords |
| bool | have_default_material |
| std::set< std::string > | mtl_lib_files |
| std::string | path_name |
| store the path name | |
Additional Inherited Members | |
Static Public Member Functions inherited from cgv::media::mesh::obj_reader_generic< T > | |
| static bool | is_double (const char *begin, const char *end, coord_type &value) |
Protected Member Functions inherited from cgv::media::mesh::obj_reader_generic< T > | |
| vec2_type | parse_vec2 (const std::vector< cgv::utils::token > &t) const |
| parse 2d vector | |
| vec3_type | parse_vec3 (const std::vector< cgv::utils::token > &t) const |
| parse 3d vector | |
| void | parse_and_process_vertex (const std::vector< cgv::utils::token > &tokens) |
| void | parse_and_process_normal (const std::vector< cgv::utils::token > &tokens) |
| void | parse_and_process_texcoord (const std::vector< cgv::utils::token > &tokens) |
Protected Member Functions inherited from cgv::media::mesh::obj_reader_base | |
| color_type | parse_color (const std::vector< cgv::utils::token > &t, unsigned off=0) const |
| parse a color, if alpha not given it defaults to 1 | |
| void | parse_face (const std::vector< cgv::utils::token > &tokens, bool is_line=false) |
| void | parse_material (const std::vector< cgv::utils::token > &tokens) |
| unsigned | get_current_group () const |
| return the index of the currently selected group or -1 if no group is defined | |
| unsigned | get_current_material () const |
| return the index of the currently selected material or -1 if no material is defined | |
| virtual void | process_comment (const std::string &comment) |
| overide this function to process a comment | |
| void | convert_to_positive (unsigned vcount, int *vertices, int *texcoords, int *normals, unsigned v, unsigned n, unsigned t) |
| convert negative indices to positive ones by adding the number of elements | |
| virtual void | process_line (unsigned vcount, int *vertices, int *texcoords=0, int *normals=0) |
| overide this function to process a line strip, the indices start with 0 | |
Definition at line 465 of file simple_mesh.cxx.
| typedef illum::obj_material::color_type cgv::media::mesh::simple_mesh_obj_reader< T >::color_type |
type used for rgba colors
Definition at line 475 of file simple_mesh.cxx.
| typedef T cgv::media::mesh::simple_mesh_obj_reader< T >::coord_type |
type of coordinates
Definition at line 469 of file simple_mesh.cxx.
| typedef simple_mesh<T>::idx_type cgv::media::mesh::simple_mesh_obj_reader< T >::idx_type |
Definition at line 477 of file simple_mesh.cxx.
| typedef cgv::math::fvec<T,2> cgv::media::mesh::simple_mesh_obj_reader< T >::vec2_type |
type used to store texture coordinates
Definition at line 471 of file simple_mesh.cxx.
| typedef cgv::math::fvec<T,3> cgv::media::mesh::simple_mesh_obj_reader< T >::vec3_type |
type used to store positions and normal vectors
Definition at line 473 of file simple_mesh.cxx.
|
inline |
Definition at line 481 of file simple_mesh.cxx.
|
inlinevirtual |
overide this function to process a color (this called for vc prefixes which is is not in the standard but for example used in pobj-files)
Reimplemented from cgv::media::mesh::obj_reader_base.
Definition at line 487 of file simple_mesh.cxx.
References cgv::media::colored_model::get_nr_colors(), cgv::media::colored_model::resize_colors(), and cgv::media::colored_model::set_color().
|
inlinevirtual |
overide this function to process a face, the indices start with 0
Reimplemented from cgv::media::mesh::obj_reader_base.
Definition at line 491 of file simple_mesh.cxx.
References cgv::media::mesh::obj_reader_base::convert_to_positive(), cgv::media::mesh::obj_reader_base::get_current_group(), and cgv::media::mesh::obj_reader_base::get_current_material().
|
inlinevirtual |
overide this function to process a group given by name and parameter string
Reimplemented from cgv::media::mesh::obj_reader_base.
Definition at line 516 of file simple_mesh.cxx.
|
inlinevirtual |
process a material definition. If a material with a certain name is overwritten, it will receive the same index
Reimplemented from cgv::media::mesh::obj_reader_base.
Definition at line 521 of file simple_mesh.cxx.
|
inlinevirtual |
overide this function to process a normal
Reimplemented from cgv::media::mesh::obj_reader_generic< T >.
Definition at line 489 of file simple_mesh.cxx.
|
inlinevirtual |
overide this function to process a texcoord
Reimplemented from cgv::media::mesh::obj_reader_generic< T >.
Definition at line 485 of file simple_mesh.cxx.
|
inlinevirtual |
overide this function to process a vertex
Reimplemented from cgv::media::mesh::obj_reader_generic< T >.
Definition at line 483 of file simple_mesh.cxx.
|
protected |
Definition at line 479 of file simple_mesh.cxx.