Panda3D
lwoToEggConverter.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 lwoToEggConverter.h
10  * @author drose
11  * @date 2001-04-17
12  */
13 
14 #ifndef LWOTOEGGCONVERTER_H
15 #define LWOTOEGGCONVERTER_H
16 
17 #include "pandatoolbase.h"
18 
20 #include "lwoHeader.h"
21 #include "pointerTo.h"
22 
23 #include "pvector.h"
24 #include "pmap.h"
25 
26 class CLwoLayer;
27 class CLwoClip;
28 class CLwoPoints;
29 class CLwoPolygons;
30 class CLwoSurface;
31 class LwoClip;
32 
33 /**
34  * This class supervises the construction of an EggData structure from the
35  * data represented by the LwoHeader. Reading and writing the egg and lwo
36  * structures is left to the user.
37  */
39 public:
42  virtual ~LwoToEggConverter();
43 
45 
46  virtual std::string get_name() const;
47  virtual std::string get_extension() const;
48 
49  virtual bool convert_file(const Filename &filename);
50  bool convert_lwo(const LwoHeader *lwo_header);
51  virtual bool supports_compressed() const;
52 
53  CLwoLayer *get_layer(int number) const;
54  CLwoClip *get_clip(int number) const;
55 
56  CLwoSurface *get_surface(const std::string &name) const;
57 
58  bool _make_materials;
59 
60 private:
61  void cleanup();
62 
63  void collect_lwo();
64  void make_egg();
65  void connect_egg();
66 
67  void slot_layer(int number);
68  void slot_clip(int number);
69  CLwoLayer *make_generic_layer();
70 
71  CPT(LwoHeader) _lwo_header;
72 
73  CLwoLayer *_generic_layer;
75  Layers _layers;
76 
77  typedef pvector<CLwoClip *> Clips;
78  Clips _clips;
79 
81  Points _points;
82 
84  Polygons _polygons;
85 
87  Surfaces _surfaces;
88 };
89 
90 #include "lwoToEggConverter.I"
91 
92 #endif
CLwoPoints
This class is a wrapper around LwoPoints and stores additional information useful during the conversi...
Definition: cLwoPoints.h:33
pvector< CLwoLayer * >
pvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pmap< std::string, CLwoSurface * >
LwoToEggConverter::get_layer
CLwoLayer * get_layer(int number) const
Returns a pointer to the layer with the given index number, or NULL if there is no such layer.
Definition: lwoToEggConverter.cxx:161
lwoHeader.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pmap.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
somethingToEggConverter.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CLwoPolygons
This class is a wrapper around LwoPolygons and stores additional information useful during the conver...
Definition: cLwoPolygons.h:36
LwoToEggConverter::get_extension
virtual std::string get_extension() const
Returns the common extension of the file type this converter supports.
Definition: lwoToEggConverter.cxx:81
SomethingToEggConverter
This is a base class for a family of converter classes that manage a conversion from some file type t...
Definition: somethingToEggConverter.h:38
LwoHeader
The first chunk in a Lightwave Object file.
Definition: lwoHeader.h:24
CLwoLayer
This class is a wrapper around LwoLayer and stores additional information useful during the conversio...
Definition: cLwoLayer.h:29
LwoToEggConverter::get_surface
CLwoSurface * get_surface(const std::string &name) const
Returns a pointer to the surface definition with the given name, or NULL if there is no such surface.
Definition: lwoToEggConverter.cxx:185
CLwoSurface
This class is a wrapper around LwoSurface and stores additional information useful during the convers...
Definition: cLwoSurface.h:39
lwoToEggConverter.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
LwoToEggConverter::get_clip
CLwoClip * get_clip(int number) const
Returns a pointer to the clip with the given index number, or NULL if there is no such clip.
Definition: lwoToEggConverter.cxx:173
LwoToEggConverter::convert_file
virtual bool convert_file(const Filename &filename)
Handles the reading of the input file and converting it to egg.
Definition: lwoToEggConverter.cxx:103
LwoToEggConverter
This class supervises the construction of an EggData structure from the data represented by the LwoHe...
Definition: lwoToEggConverter.h:38
LwoClip
A single image file, or a numbered sequence of images (e.g.
Definition: lwoClip.h:25
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
LwoToEggConverter::get_name
virtual std::string get_name() const
Returns the English name of the file type this converter supports.
Definition: lwoToEggConverter.cxx:73
LwoToEggConverter::convert_lwo
bool convert_lwo(const LwoHeader *lwo_header)
Fills up the egg_data structure according to the indicated lwo structure.
Definition: lwoToEggConverter.cxx:138
CLwoClip
This class is a wrapper around LwoClip and stores additional information useful during the conversion...
Definition: cLwoClip.h:29
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Filename
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
LwoToEggConverter::supports_compressed
virtual bool supports_compressed() const
Returns true if this file type can transparently load compressed files (with a .pz extension),...
Definition: lwoToEggConverter.cxx:90
LwoToEggConverter::make_copy
virtual SomethingToEggConverter * make_copy()
Allocates and returns a new copy of the converter.
Definition: lwoToEggConverter.cxx:65