Panda3D
|
00001 // Filename: eggTable.h 00002 // Created by: drose (19Feb99) 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 EGGTABLE_H 00016 #define EGGTABLE_H 00017 00018 #include "pandabase.h" 00019 00020 #include "eggGroupNode.h" 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Class : EggTable 00024 // Description : This corresponds to a <Table> or a <Bundle> entry. 00025 // As such, it doesn't actually contain a table of 00026 // numbers, but it may be a parent to an EggSAnimData or 00027 // an EggXfmAnimData, which do. It may also be a parent 00028 // to another <Table> or <Bundle>, establishing a 00029 // hierarchy of tables. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDAEGG EggTable : public EggGroupNode { 00032 PUBLISHED: 00033 enum TableType { 00034 TT_invalid, 00035 TT_table, 00036 TT_bundle, 00037 }; 00038 00039 INLINE EggTable(const string &name = ""); 00040 INLINE EggTable(const EggTable ©); 00041 INLINE EggTable &operator = (const EggTable ©); 00042 00043 INLINE void set_table_type(TableType type); 00044 INLINE TableType get_table_type() const; 00045 00046 bool has_transform() const; 00047 virtual void write(ostream &out, int indent_level) const; 00048 00049 static TableType string_table_type(const string &string); 00050 00051 protected: 00052 virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv, 00053 CoordinateSystem to_cs); 00054 00055 private: 00056 TableType _type; 00057 00058 00059 public: 00060 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 static void init_type() { 00065 EggGroupNode::init_type(); 00066 register_type(_type_handle, "EggTable", 00067 EggGroupNode::get_class_type()); 00068 } 00069 virtual TypeHandle get_type() const { 00070 return get_class_type(); 00071 } 00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 ostream &operator << (ostream &out, EggTable::TableType t); 00079 00080 #include "eggTable.I" 00081 00082 #endif 00083