15 #ifndef OBJTOEGGCONVERTER_H 16 #define OBJTOEGGCONVERTER_H 18 #include "pandatoolbase.h" 20 #include "somethingToEggConverter.h" 21 #include "eggVertexPool.h" 23 #include "geomVertexData.h" 24 #include "geomVertexWriter.h" 25 #include "geomPrimitive.h" 27 #include "pandaNode.h" 52 bool process(
const Filename &filename);
53 bool process_line(
const string &line);
54 bool process_ref_plane_res(
const string &line);
56 bool process_v(vector_string &words);
57 bool process_vt(vector_string &words);
58 bool process_xvt(vector_string &words);
59 bool process_xvc(vector_string &words);
60 bool process_vn(vector_string &words);
61 bool process_f(vector_string &words);
62 bool process_g(vector_string &words);
64 EggVertex *get_face_vertex(
const string &face_reference);
66 bool process_node(
const Filename &filename);
67 bool process_line_node(
const string &line);
69 bool process_f_node(vector_string &words);
70 bool process_g_node(vector_string &words);
72 void generate_points();
73 int add_synth_normal(
const LVecBase3 &normal);
77 typedef epvector<LVecBase4> Vec4Table;
78 typedef epvector<LVecBase3> Vec3Table;
79 typedef epvector<LVecBase2> Vec2Table;
83 Vec3Table _vn_table, _rgb_table;
86 Vec3Table _synth_vn_table;
87 UniqueVec3Table _unique_synth_vn_table;
89 bool _v4_given, _vt3_given;
107 INLINE
bool operator < (
const VertexEntry &other)
const;
108 INLINE
bool operator == (
const VertexEntry &other)
const;
109 INLINE
bool matches_except_normal(
const VertexEntry &other)
const;
124 VertexData(
PandaNode *parent,
const string &name);
128 const VertexEntry &v1,
const VertexEntry &v2,
137 VertexEntries _entries;
138 UniqueVertexEntries _unique_entries;
140 bool _v4_given, _vt3_given;
141 bool _vt_given, _rgb_given, _vn_given;
144 VertexData *_current_vertex_data;
146 friend class VertexData;
149 #include "objToEggConverter.I" A basic node of the scene graph or data graph.
This is the base class for all three-component vectors and points.
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
Specifies parameters that may be passed to the loader.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
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 bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
virtual bool supports_convert_to_node(const LoaderOptions &options) const
Returns true if this converter can directly convert the model type to internal Panda memory structure...
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
The name of a file, such as a texture file or an Egg file.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
Convert an Obj file to egg data.
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension)...
This is the base class for all two-component vectors and points.
This is a base class for a family of converter classes that manage a conversion from some file type t...
A collection of vertices.
A node that holds Geom objects, renderable pieces of geometry.