Panda3D
 All Classes Functions Variables Enumerations
eggObject.h
1 // Filename: eggObject.h
2 // Created by: drose (17Jan99)
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 EGGOBJECT_H
16 #define EGGOBJECT_H
17 
18 #include "pandabase.h"
19 #include "eggUserData.h"
20 #include "typedReferenceCount.h"
21 #include "pointerTo.h"
22 #include "pmap.h"
23 
24 class EggTransform;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : EggObject
28 // Description : The highest-level base class in the egg directory.
29 // (Almost) all things egg inherit from this.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDAEGG EggObject : public TypedReferenceCount {
32 PUBLISHED:
33  EggObject();
34  EggObject(const EggObject &copy);
35  EggObject &operator = (const EggObject &copy);
36 
37  virtual ~EggObject();
38 
39  void set_user_data(EggUserData *user_data);
40  EggUserData *get_user_data() const;
41  EggUserData *get_user_data(TypeHandle type) const;
42  bool has_user_data() const;
43  bool has_user_data(TypeHandle type) const;
44  void clear_user_data();
45  void clear_user_data(TypeHandle type);
46 
47 public:
48  virtual EggTransform *as_transform();
49 
50 private:
52  UserData _user_data;
53  PT(EggUserData) _default_user_data;
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  TypedReferenceCount::init_type();
61  register_type(_type_handle, "EggObject",
62  TypedReferenceCount::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "eggObject.I"
74 
75 #endif
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is a base class for a user-defined data type to extend egg structures in processing code...
Definition: eggUserData.h:34
The highest-level base class in the egg directory.
Definition: eggObject.h:31
This represents the <Transform> entry of a group or texture node: a list of component transform opera...
Definition: eggTransform.h:33