Panda3D
 All Classes Functions Variables Enumerations
geomDrawCallbackData.I
1 // Filename: geomDrawCallbackData.I
2 // Created by: drose (13Mar09)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GeomDrawCallbackData::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE GeomDrawCallbackData::
22 GeomDrawCallbackData(CullableObject *obj, GraphicsStateGuardianBase *gsg,
23  bool force) :
24  _obj(obj),
25  _gsg(gsg),
26  _force(force),
27  _lost_state(true)
28 {
29 }
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: GeomDrawCallbackData::get_object
33 // Access: Published
34 // Description: Returns a pointer to the particular object that is
35 // being drawn.
36 ////////////////////////////////////////////////////////////////////
38 get_object() const {
39  return _obj;
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: GeomDrawCallbackData::get_gsg
44 // Access: Published
45 // Description: Returns a pointer to the current GSG.
46 ////////////////////////////////////////////////////////////////////
48 get_gsg() const {
49  return _gsg;
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: GeomDrawCallbackData::get_force
54 // Access: Published
55 // Description: Returns true if any required data should be forced
56 // into memory if necessary to render the object, or
57 // false if the object should be omitted if some of the
58 // data is not available (at least until the data
59 // becomes available later).
60 ////////////////////////////////////////////////////////////////////
61 INLINE bool GeomDrawCallbackData::
62 get_force() const {
63  return _force;
64 }
65 
66 ////////////////////////////////////////////////////////////////////
67 // Function: GeomDrawCallbackData::set_lost_state
68 // Access: Published
69 // Description: Sets the lost_state flag. If this is true, the
70 // callback does not have to be quite so careful to
71 // clean up after itself; Panda will assume that the
72 // graphics state is in an unknown state after the
73 // callback has finished, and will issue all the
74 // necessary calls to restore it. If this is false,
75 // Panda will assume the callback will leave the
76 // graphics state exactly as it came in, and won't
77 // bother to try to restore it. The default is true.
78 ////////////////////////////////////////////////////////////////////
79 INLINE void GeomDrawCallbackData::
80 set_lost_state(bool lost_state) {
81  _lost_state = lost_state;
82 }
83 
84 ////////////////////////////////////////////////////////////////////
85 // Function: GeomDrawCallbackData::get_lost_state
86 // Access: Published
87 // Description: Returns the lost_state flag. See set_lost_state().
88 ////////////////////////////////////////////////////////////////////
89 INLINE bool GeomDrawCallbackData::
90 get_lost_state() const {
91  return _lost_state;
92 }
GraphicsStateGuardianBase * get_gsg() const
Returns a pointer to the current GSG.
The smallest atom of cull.
bool get_lost_state() const
Returns the lost_state flag.
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...
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.