Panda3D
geomDrawCallbackData.I
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.I
10  * @author drose
11  * @date 2009-03-13
12  */
13 
14 /**
15  *
16  */
17 INLINE GeomDrawCallbackData::
18 GeomDrawCallbackData(CullableObject *obj, GraphicsStateGuardianBase *gsg,
19  bool force) :
20  _obj(obj),
21  _gsg(gsg),
22  _force(force),
23  _lost_state(true)
24 {
25 }
26 
27 /**
28  * Returns a pointer to the particular object that is being drawn.
29  */
31 get_object() const {
32  return _obj;
33 }
34 
35 /**
36  * Returns a pointer to the current GSG.
37  */
39 get_gsg() const {
40  return _gsg;
41 }
42 
43 /**
44  * Returns true if any required data should be forced into memory if necessary
45  * to render the object, or false if the object should be omitted if some of
46  * the data is not available (at least until the data becomes available
47  * later).
48  */
49 INLINE bool GeomDrawCallbackData::
50 get_force() const {
51  return _force;
52 }
53 
54 /**
55  * Sets the lost_state flag. If this is true, the callback does not have to
56  * be quite so careful to clean up after itself; Panda will assume that the
57  * graphics state is in an unknown state after the callback has finished, and
58  * will issue all the necessary calls to restore it. If this is false, Panda
59  * will assume the callback will leave the graphics state exactly as it came
60  * in, and won't bother to try to restore it. The default is true.
61  */
62 INLINE void GeomDrawCallbackData::
63 set_lost_state(bool lost_state) {
64  _lost_state = lost_state;
65 }
66 
67 /**
68  * Returns the lost_state flag. See set_lost_state().
69  */
70 INLINE bool GeomDrawCallbackData::
71 get_lost_state() const {
72  return _lost_state;
73 }
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.
The smallest atom of cull.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
bool get_lost_state() const
Returns the lost_state flag.
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.