Panda3D
eggToFlt.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file eggToFlt.h
10  * @author drose
11  * @date 2003-10-01
12  */
13 
14 #ifndef EGGTOFLT_H
15 #define EGGTOFLT_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "eggToSomething.h"
20 #include "fltHeader.h"
21 #include "fltGeometry.h"
22 #include "pointerTo.h"
23 #include "pmap.h"
24 #include "vector_string.h"
25 
26 class EggGroup;
27 class EggVertex;
28 class EggPrimitive;
29 class EggTexture;
30 class EggTransform;
31 class FltVertex;
32 class FltBead;
33 class FltTexture;
34 
35 /**
36  * A program to read an egg file and write a flt file.
37  */
38 class EggToFlt : public EggToSomething {
39 public:
40  EggToFlt();
41 
42  void run();
43 
44 private:
45  static bool dispatch_attr(const std::string &opt, const std::string &arg, void *var);
46 
47  void traverse(EggNode *egg_node, FltBead *flt_node,
48  FltGeometry::BillboardType billboard);
49  void convert_primitive(EggPrimitive *egg_primitive, FltBead *flt_node,
50  FltGeometry::BillboardType billboard);
51  void convert_group(EggGroup *egg_group, FltBead *flt_node,
52  FltGeometry::BillboardType billboard);
53  void apply_transform(EggTransform *egg_transform, FltBead *flt_node);
54  void apply_egg_syntax(const std::string &egg_syntax, FltRecord *flt_record);
55  FltVertex *get_flt_vertex(EggVertex *egg_vertex, EggNode *context);
56  FltTexture *get_flt_texture(EggTexture *egg_texture);
57 
58  FltHeader::AttrUpdate _auto_attr_update;
59 
60  PT(FltHeader) _flt_header;
61 
64  VertexMapPerFrame _vertex_map_per_frame;
65 
67  TextureMap _texture_map;
68 };
69 
70 #endif
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
Definition: eggGroup.h:34
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:36
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
Definition: eggPrimitive.h:49
Defines a texture map that may be applied to geometry.
Definition: eggTexture.h:30
A program to read an egg file and write a flt file.
Definition: eggToFlt.h:38
This is the general base class for a file-converter program that reads some model file format and gen...
This represents the <Transform> entry of a group or texture node: a list of component transform opera...
Definition: eggTransform.h:29
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal.
Definition: eggVertex.h:39
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h:29
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:44
The base class for all kinds of records in a MultiGen OpenFlight file.
Definition: fltRecord.h:36
Represents a single texture in the texture palette.
Definition: fltTexture.h:27
Represents a single vertex in the vertex palette.
Definition: fltVertex.h:32
This is our own Panda specialization on the default STL map.
Definition: pmap.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.