Panda3D
geomDrawCallbackData.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 geomDrawCallbackData.h
10  * @author drose
11  * @date 2009-03-13
12  */
13 
14 #ifndef GEOMDRAWCALLBACKDATA_H
15 #define GEOMDRAWCALLBACKDATA_H
16 
17 #include "pandabase.h"
18 #include "callbackData.h"
19 
20 // Forward declarations
21 class CullableObject;
23 
24 /**
25  * This specialization on CallbackData is passed when the callback is
26  * initiated from deep within the draw traversal, for a particular Geom.
27  */
28 class EXPCL_PANDA_PGRAPH GeomDrawCallbackData : public CallbackData {
29 public:
31  GraphicsStateGuardianBase *gsg, bool force);
32 
33 PUBLISHED:
34  virtual void output(std::ostream &out) const;
35 
36  INLINE CullableObject *get_object() const;
37  INLINE GraphicsStateGuardianBase *get_gsg() const;
38  INLINE bool get_force() const;
39 
40  INLINE void set_lost_state(bool lost_state);
41  INLINE bool get_lost_state() const;
42 
43  virtual void upcall();
44 
45 private:
46  CullableObject *_obj;
48  bool _force;
49  bool _lost_state;
50 
51 public:
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  CallbackData::init_type();
57  register_type(_type_handle, "GeomDrawCallbackData",
58  CallbackData::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64 
65 private:
66  static TypeHandle _type_handle;
67 };
68 
69 #include "geomDrawCallbackData.I"
70 
71 #endif
This specialization on CallbackData is passed when the callback is initiated from deep within the dra...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void upcall()
You should make this call during the callback if you want to continue the normal function that would ...
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.
This is a generic data block that is passed along to a CallbackObject when a callback is made.
Definition: callbackData.h:29
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The smallest atom of cull.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81