Panda3D
lwoInputFile.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 lwoInputFile.h
10  * @author drose
11  * @date 2001-04-24
12  */
13 
14 #ifndef LWOINPUTFILE_H
15 #define LWOINPUTFILE_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "iffInputFile.h"
20 
21 #include "luse.h"
22 
23 /**
24  * A specialization of IffInputFile to handle reading a Lightwave Object file.
25  */
26 class LwoInputFile : public IffInputFile {
27 public:
28  LwoInputFile();
29  ~LwoInputFile();
30 
31  INLINE double get_lwo_version() const;
32  INLINE void set_lwo_version(double version);
33 
34  int get_vx();
35  LVecBase3 get_vec3();
37 
38 protected:
39  virtual IffChunk *make_new_chunk(IffId id);
40 
41 private:
42  double _lwo_version;
43 
44 public:
45  virtual TypeHandle get_type() const {
46  return get_class_type();
47  }
48  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
49  static TypeHandle get_class_type() {
50  return _type_handle;
51  }
52  static void init_type() {
53  IffInputFile::init_type();
54  register_type(_type_handle, "LwoInputFile",
55  IffInputFile::get_class_type());
56  }
57 
58 private:
59  static TypeHandle _type_handle;
60 };
61 
62 #include "lwoInputFile.I"
63 
64 #endif
void set_lwo_version(double version)
Changes the version number reported for the Lightwave file.
Definition: lwoInputFile.I:29
int get_vx()
Reads a Lightwave variable-length index.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
LVecBase3 get_vec3()
Reads a three-component vector of floats.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
Filename get_filename()
Reads a Lightwave platform-neutral filename and converts it to a Panda platform-neutral filename.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
double get_lwo_version() const
Returns the version of the Lightwave file being read.
Definition: lwoInputFile.I:19
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on.
Definition: iffChunk.h:30
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:39
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:30
A specialization of IffInputFile to handle reading a Lightwave Object file.
Definition: lwoInputFile.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
A four-byte chunk ID appearing in an "IFF" file.
Definition: iffId.h:26