Panda3D
|
00001 // Filename: lwoGroupChunk.h 00002 // Created by: drose (24Apr01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef LWOGROUPCHUNK_H 00016 #define LWOGROUPCHUNK_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "lwoChunk.h" 00021 #include "iffChunk.h" 00022 00023 #include "pointerTo.h" 00024 00025 #include "pvector.h" 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : LwoGroupChunk 00029 // Description : A particular kind of LwoChunk that is expected to 00030 // contain an arbitrary number of child chunks. 00031 //////////////////////////////////////////////////////////////////// 00032 class LwoGroupChunk : public LwoChunk { 00033 public: 00034 int get_num_chunks() const; 00035 IffChunk *get_chunk(int n) const; 00036 00037 protected: 00038 bool read_chunks_iff(IffInputFile *in, size_t stop_at); 00039 bool read_subchunks_iff(IffInputFile *in, size_t stop_at); 00040 void write_chunks(ostream &out, int indent_level) const; 00041 00042 typedef pvector< PT(IffChunk) > Chunks; 00043 Chunks _chunks; 00044 00045 public: 00046 virtual TypeHandle get_type() const { 00047 return get_class_type(); 00048 } 00049 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00050 static TypeHandle get_class_type() { 00051 return _type_handle; 00052 } 00053 static void init_type() { 00054 LwoChunk::init_type(); 00055 register_type(_type_handle, "LwoGroupChunk", 00056 LwoChunk::get_class_type()); 00057 } 00058 00059 private: 00060 static TypeHandle _type_handle; 00061 }; 00062 00063 #endif 00064 00065