00001 // Filename: eggTable.h 00002 // Created by: drose (19Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef EGGTABLE_H 00020 #define EGGTABLE_H 00021 00022 #include <pandabase.h> 00023 00024 #include "eggGroupNode.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : EggTable 00028 // Description : This corresponds to a <Table> or a <Bundle> entry. 00029 // As such, it doesn't actually contain a table of 00030 // numbers, but it may be a parent to an EggSAnimData or 00031 // an EggXfmAnimData, which do. It may also be a parent 00032 // to another <Table> or <Bundle>, establishing a 00033 // hierarchy of tables. 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_PANDAEGG EggTable : public EggGroupNode { 00036 public: 00037 enum TableType { 00038 TT_invalid, 00039 TT_table, 00040 TT_bundle, 00041 }; 00042 00043 INLINE EggTable(const string &name = ""); 00044 INLINE EggTable(const EggTable ©); 00045 INLINE EggTable &operator = (const EggTable ©); 00046 00047 INLINE void set_table_type(TableType type); 00048 INLINE TableType get_table_type() const; 00049 00050 virtual void write(ostream &out, int indent_level) const; 00051 00052 static TableType string_table_type(const string &string); 00053 00054 private: 00055 TableType _type; 00056 00057 00058 public: 00059 00060 static TypeHandle get_class_type() { 00061 return _type_handle; 00062 } 00063 static void init_type() { 00064 EggGroupNode::init_type(); 00065 register_type(_type_handle, "EggTable", 00066 EggGroupNode::get_class_type()); 00067 } 00068 virtual TypeHandle get_type() const { 00069 return get_class_type(); 00070 } 00071 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00072 00073 private: 00074 static TypeHandle _type_handle; 00075 }; 00076 00077 ostream &operator << (ostream &out, EggTable::TableType t); 00078 00079 #include "eggTable.I" 00080 00081 #endif 00082