Panda3D
|
Convert an Obj file to egg data. More...
#include "objToEggConverter.h"
Public Member Functions | |
ObjToEggConverter (const ObjToEggConverter ©) | |
virtual bool | convert_file (const Filename &filename) |
Handles the reading of the input file and converting it to egg. | |
virtual string | get_extension () const |
Returns the common extension of the file type this converter supports. | |
virtual string | get_name () const |
Returns the English name of the file type this converter supports. | |
virtual SomethingToEggConverter * | make_copy () |
Allocates and returns a new copy of the converter. | |
virtual bool | supports_compressed () const |
Returns true if this file type can transparently load compressed files (with a .pz extension), false otherwise. | |
Protected Member Functions | |
EggVertex * | get_face_vertex (const string &face_reference) |
Returns or creates a vertex in the vpool according to the indicated face reference. | |
EggVertex * | get_vertex (int n) |
Returns or creates a vertex in the vpool with the given index. | |
bool | process (const Filename &filename) |
bool | process_f (vector_string &words) |
Defines a face in the obj file. | |
bool | process_g (vector_string &words) |
Defines a group in the obj file. | |
bool | process_line (const string &line) |
bool | process_v (vector_string &words) |
bool | process_vn (vector_string &words) |
bool | process_vt (vector_string &words) |
PT (EggVertexPool) _vpool | |
PT (EggGroup) _root_group | |
Protected Attributes | |
EggGroup * | _current_group |
pset< string > | _ignored_tags |
int | _line_number |
int | _vi |
int | _vni |
int | _vti |
Convert an Obj file to egg data.
Definition at line 28 of file objToEggConverter.h.
bool ObjToEggConverter::convert_file | ( | const Filename & | filename | ) | [virtual] |
Handles the reading of the input file and converting it to egg.
Returns true if successful, false otherwise.
Implements SomethingToEggConverter.
Definition at line 106 of file objToEggConverter.cxx.
References SomethingToEggConverter::clear_error(), and SomethingToEggConverter::had_error().
string ObjToEggConverter::get_extension | ( | ) | const [virtual] |
Returns the common extension of the file type this converter supports.
Implements SomethingToEggConverter.
Definition at line 82 of file objToEggConverter.cxx.
EggVertex * ObjToEggConverter::get_face_vertex | ( | const string & | face_reference | ) | [protected] |
Returns or creates a vertex in the vpool according to the indicated face reference.
Definition at line 399 of file objToEggConverter.cxx.
References get_vertex(), EggVertex::set_uv(), and EggVertex::set_uvw().
Referenced by process_f().
string ObjToEggConverter::get_name | ( | ) | const [virtual] |
Returns the English name of the file type this converter supports.
Implements SomethingToEggConverter.
Definition at line 71 of file objToEggConverter.cxx.
EggVertex * ObjToEggConverter::get_vertex | ( | int | n | ) | [protected] |
Returns or creates a vertex in the vpool with the given index.
Definition at line 378 of file objToEggConverter.cxx.
Referenced by get_face_vertex().
SomethingToEggConverter * ObjToEggConverter::make_copy | ( | ) | [virtual] |
Allocates and returns a new copy of the converter.
Implements SomethingToEggConverter.
Definition at line 59 of file objToEggConverter.cxx.
bool ObjToEggConverter::process_f | ( | vector_string & | words | ) | [protected] |
Defines a face in the obj file.
Definition at line 328 of file objToEggConverter.cxx.
References EggGroupNode::add_child(), and get_face_vertex().
bool ObjToEggConverter::process_g | ( | vector_string & | words | ) | [protected] |
Defines a group in the obj file.
Definition at line 348 of file objToEggConverter.cxx.
References EggGroupNode::add_child(), EggGroupNode::find_child(), and TypedObject::is_of_type().
bool ObjToEggConverter::supports_compressed | ( | ) | const [virtual] |
Returns true if this file type can transparently load compressed files (with a .pz extension), false otherwise.
Reimplemented from SomethingToEggConverter.
Definition at line 94 of file objToEggConverter.cxx.