Panda3D
eggTable.h
1 // Filename: eggTable.h
2 // Created by: drose (19Feb99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGTABLE_H
16 #define EGGTABLE_H
17 
18 #include "pandabase.h"
19 
20 #include "eggGroupNode.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : EggTable
24 // Description : This corresponds to a <Table> or a <Bundle> entry.
25 // As such, it doesn't actually contain a table of
26 // numbers, but it may be a parent to an EggSAnimData or
27 // an EggXfmAnimData, which do. It may also be a parent
28 // to another <Table> or <Bundle>, establishing a
29 // hierarchy of tables.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDAEGG EggTable : public EggGroupNode {
32 PUBLISHED:
33  enum TableType {
34  TT_invalid,
35  TT_table,
36  TT_bundle,
37  };
38 
39  INLINE EggTable(const string &name = "");
40  INLINE EggTable(const EggTable &copy);
41  INLINE EggTable &operator = (const EggTable &copy);
42 
43  INLINE void set_table_type(TableType type);
44  INLINE TableType get_table_type() const;
45 
46  bool has_transform() const;
47  virtual void write(ostream &out, int indent_level) const;
48 
49  static TableType string_table_type(const string &string);
50 
51 protected:
52  virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
53  CoordinateSystem to_cs);
54 
55 private:
56  TableType _type;
57 
58 
59 public:
60 
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  EggGroupNode::init_type();
66  register_type(_type_handle, "EggTable",
67  EggGroupNode::get_class_type());
68  }
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73 
74 private:
75  static TypeHandle _type_handle;
76 };
77 
78 ostream &operator << (ostream &out, EggTable::TableType t);
79 
80 #include "eggTable.I"
81 
82 #endif
83 
virtual void write(ostream &out, int indent_level) const
Writes the group and all of its children to the indicated output stream in Egg format.
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:51
This corresponds to a.
Definition: eggTable.h:31
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85