Panda3D
 All Classes Functions Variables Enumerations
geomDrawCallbackData.cxx
1 // Filename: geomDrawCallbackData.cxx
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 #include "geomDrawCallbackData.h"
16 #include "cullableObject.h"
17 #include "graphicsStateGuardianBase.h"
18 
19 TypeHandle GeomDrawCallbackData::_type_handle;
20 
21 ////////////////////////////////////////////////////////////////////
22 // Function: GeomDrawCallbackData::output
23 // Access: Published, Virtual
24 // Description:
25 ////////////////////////////////////////////////////////////////////
26 void GeomDrawCallbackData::
27 output(ostream &out) const {
28  out << get_type() << "(" << (void *)_obj << ", " << (void *)_gsg
29  << ", " << _force << ")";
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: GeomDrawCallbackData::upcall
34 // Access: Published, Virtual
35 // Description: You should make this call during the callback if you
36 // want to continue the normal rendering function that
37 // would have been done in the absence of a callback.
38 //
39 // Specifically, this method will add the Geoms in this
40 // node to the list of renderable objects for drawing.
41 // If this callback was made on a CallbackNode, it
42 // doesn't actually do anything, since only a GeomNode
43 // holds geoms.
44 ////////////////////////////////////////////////////////////////////
46 upcall() {
47  // Go ahead and draw the object, if we have one.
48  if (_obj->_geom != (Geom *)NULL) {
49  if (_lost_state) {
50  // Tell the GSG to forget its state.
51  _gsg->clear_state_and_transform();
52  }
53 
54  _obj->_geom->draw(_gsg, _obj->_munger, _obj->_munged_data, _force,
56  }
57 }
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
Definition: thread.I:145
void draw(GraphicsStateGuardianBase *gsg, bool force, Thread *current_thread)
Draws the cullable object on the GSG immediately, in the GSG&#39;s current state.
A container for geometry primitives.
Definition: geom.h:58
virtual void upcall()
You should make this call during the callback if you want to continue the normal rendering function t...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85