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