Panda3D
lwoHeader.h
1 // Filename: lwoHeader.h
2 // Created by: drose (24Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef LWOHEADER_H
16 #define LWOHEADER_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoGroupChunk.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : LwoHeader
24 // Description : The first chunk in a Lightwave Object file.
25 ////////////////////////////////////////////////////////////////////
26 class LwoHeader : public LwoGroupChunk {
27 public:
28  LwoHeader();
29 
30  IffId _lwid;
31 
32  INLINE bool is_valid() const;
33  INLINE double get_version() const;
34 
35 public:
36  virtual bool read_iff(IffInputFile *in, size_t stop_at);
37  virtual void write(ostream &out, int indent_level = 0) const;
38 
39 private:
40  bool _valid;
41  double _version;
42 
43 public:
44  virtual TypeHandle get_type() const {
45  return get_class_type();
46  }
47  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  LwoGroupChunk::init_type();
53  register_type(_type_handle, "LwoHeader",
54  LwoGroupChunk::get_class_type());
55  }
56 
57 private:
58  static TypeHandle _type_handle;
59 };
60 
61 #include "lwoHeader.I"
62 
63 #endif
64 
65 
double get_version() const
Returns the version of the Lightwave file.
Definition: lwoHeader.I:33
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
Definition: lwoHeader.cxx:45
The first chunk in a Lightwave Object file.
Definition: lwoHeader.h:26
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
bool is_valid() const
Returns true if the header represents a valid and recognized Lightwave header, false otherwise...
Definition: lwoHeader.I:23
A particular kind of LwoChunk that is expected to contain an arbitrary number of child chunks...
Definition: lwoGroupChunk.h:32
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A four-byte chunk ID appearing in an "IFF" file.
Definition: iffId.h:29