Panda3D
Loading...
Searching...
No Matches
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
21class 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 */
28class EXPCL_PANDA_PGRAPH GeomDrawCallbackData : public CallbackData {
29public:
30 INLINE GeomDrawCallbackData(CullableObject *obj,
31 GraphicsStateGuardianBase *gsg, bool force);
32
33PUBLISHED:
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
45private:
46 CullableObject *_obj;
48 bool _force;
49 bool _lost_state;
50
51public:
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
65private:
66 static TypeHandle _type_handle;
67};
68
70
71#endif
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 ...
The smallest atom of cull.
bool get_force() const
Returns true if any required data should be forced into memory if necessary to render the object,...
void set_lost_state(bool lost_state)
Sets the lost_state flag.
bool get_lost_state() const
Returns the lost_state flag.
GraphicsStateGuardianBase * get_gsg() const
Returns a pointer to the current GSG.
CullableObject * get_object() const
Returns a pointer to the particular object that is being drawn.
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...