00001 // Filename: iffChunk.cxx 00002 // Created by: drose (23Apr01) 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 #include "iffChunk.h" 00016 #include "iffInputFile.h" 00017 00018 #include "indent.h" 00019 00020 TypeHandle IffChunk::_type_handle; 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Function: IffChunk::output 00024 // Access: Public, Virtual 00025 // Description: 00026 //////////////////////////////////////////////////////////////////// 00027 void IffChunk:: 00028 output(ostream &out) const { 00029 out << _id << " (" << get_type() << ")"; 00030 } 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Function: IffChunk::write 00034 // Access: Public, Virtual 00035 // Description: 00036 //////////////////////////////////////////////////////////////////// 00037 void IffChunk:: 00038 write(ostream &out, int indent_level) const { 00039 indent(out, indent_level) << _id << " { ... }\n"; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: IffChunk::make_new_chunk 00044 // Access: Public, Virtual 00045 // Description: Allocates and returns a new chunk of the appropriate 00046 // type based on the given ID, according to the context 00047 // given by this chunk itself. 00048 //////////////////////////////////////////////////////////////////// 00049 IffChunk *IffChunk:: 00050 make_new_chunk(IffInputFile *in, IffId id) { 00051 return in->make_new_chunk(id); 00052 }