Panda3D
|
00001 // Filename: fltInstanceRef.h 00002 // Created by: drose (30Aug00) 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 FLTINSTANCEREF_H 00016 #define FLTINSTANCEREF_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "fltBead.h" 00021 00022 class FltInstanceDefinition; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : FltInstanceRef 00026 // Description : This bead appears in the hierarchy to refer to a 00027 // FltInstanceDefinition node defined elsewhere. It 00028 // indicates that the subtree beginning at the 00029 // FltInstanceDefinition should be considered to be 00030 // instanced here. 00031 //////////////////////////////////////////////////////////////////// 00032 class FltInstanceRef : public FltBead { 00033 public: 00034 FltInstanceRef(FltHeader *header); 00035 00036 int _instance_index; 00037 00038 FltInstanceDefinition *get_instance() const; 00039 00040 virtual void write(ostream &out, int indent_level = 0) const; 00041 00042 protected: 00043 virtual bool extract_record(FltRecordReader &reader); 00044 virtual FltError write_record_and_children(FltRecordWriter &writer) const; 00045 virtual bool build_record(FltRecordWriter &writer) const; 00046 00047 public: 00048 virtual TypeHandle get_type() const { 00049 return get_class_type(); 00050 } 00051 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00052 static TypeHandle get_class_type() { 00053 return _type_handle; 00054 } 00055 static void init_type() { 00056 FltBead::init_type(); 00057 register_type(_type_handle, "FltInstanceRef", 00058 FltBead::get_class_type()); 00059 } 00060 00061 private: 00062 static TypeHandle _type_handle; 00063 }; 00064 00065 #endif 00066 00067