Panda3D
 All Classes Functions Variables Enumerations
lwoGroupChunk.h
1 // Filename: lwoGroupChunk.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 LWOGROUPCHUNK_H
16 #define LWOGROUPCHUNK_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "lwoChunk.h"
21 #include "iffChunk.h"
22 
23 #include "pointerTo.h"
24 
25 #include "pvector.h"
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : LwoGroupChunk
29 // Description : A particular kind of LwoChunk that is expected to
30 // contain an arbitrary number of child chunks.
31 ////////////////////////////////////////////////////////////////////
32 class LwoGroupChunk : public LwoChunk {
33 public:
34  int get_num_chunks() const;
35  IffChunk *get_chunk(int n) const;
36 
37 protected:
38  bool read_chunks_iff(IffInputFile *in, size_t stop_at);
39  bool read_subchunks_iff(IffInputFile *in, size_t stop_at);
40  void write_chunks(ostream &out, int indent_level) const;
41 
43  Chunks _chunks;
44 
45 public:
46  virtual TypeHandle get_type() const {
47  return get_class_type();
48  }
49  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
50  static TypeHandle get_class_type() {
51  return _type_handle;
52  }
53  static void init_type() {
54  LwoChunk::init_type();
55  register_type(_type_handle, "LwoGroupChunk",
56  LwoChunk::get_class_type());
57  }
58 
59 private:
60  static TypeHandle _type_handle;
61 };
62 
63 #endif
64 
65 
int get_num_chunks() const
Returns the number of child chunks of this group.
IffChunk * get_chunk(int n) const
Returns the nth child chunk of this group.
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
Definition: iffChunk.h:32
A specialization of IffChunk for Lightwave Object files.
Definition: lwoChunk.h:29
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
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