Panda3D

displayRegionCullCallbackData.cxx
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 displayRegionCullCallbackData.cxx
10 * @author drose
11 * @date 2009-03-14
12 */
13
14 #include "displayRegionCullCallbackData.h"
15 #include "cullHandler.h"
16 #include "sceneSetup.h"
17 #include "graphicsEngine.h"
18
19 TypeHandle DisplayRegionCullCallbackData::_type_handle;
20
21
22 /**
23 *
24 */
25 DisplayRegionCullCallbackData::
26 DisplayRegionCullCallbackData(CullHandler *cull_handler, SceneSetup *scene_setup) :
27 _cull_handler(cull_handler),
28 _scene_setup(scene_setup)
29 {
30 }
31
32 /**
33 *
34 */
35 void DisplayRegionCullCallbackData::
36 output(std::ostream &out) const {
37 out << get_type() << "(" << (void *)_cull_handler << ", "
38 << (void *)_scene_setup << ")";
39 }
40
41 /**
42 * You should make this call during the callback if you want to continue the
43 * normal rendering function that would have been done in the absence of a
44 * callback.
45 *
46 * Specifically, this method will perform the cull traversal for the
47 * DisplayRegion's scene graph, and add all renderable objects to its
48 * CullResult.
49 */
50 void DisplayRegionCullCallbackData::
51 upcall() {
52 Thread *current_thread = Thread::get_current_thread();
53 DisplayRegion *dr = _scene_setup->get_display_region();
54 GraphicsStateGuardian *gsg = dr->get_window()->get_gsg();
55
56 dr->do_cull(_cull_handler, _scene_setup, gsg, current_thread);
57 }
CullHandler
This defines the abstract interface for an object that receives Geoms identified by the CullTraverser...
Definition: cullHandler.h:28
DisplayRegionCullCallbackData::upcall
virtual void upcall()
You should make this call during the callback if you want to continue the normal rendering function t...
Definition: displayRegionCullCallbackData.cxx:51
DisplayRegion
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:57
DisplayRegion::get_window
get_window
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
Definition: displayRegion.h:88
GraphicsStateGuardian
Encapsulates all the communication with a particular instance of a given rendering backend.
Definition: graphicsStateGuardian.h:65
SceneSetup
This object holds the camera position, etc., and other general setup information for rendering a part...
Definition: sceneSetup.h:32
SceneSetup::get_display_region
DisplayRegion * get_display_region() const
Returns the display region for the scene.
Definition: sceneSetup.I:42
Thread
A thread; that is, a lightweight process.
Definition: thread.h:46
Thread::get_current_thread
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition: thread.h:109
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
cullHandler.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
displayRegionCullCallbackData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
graphicsEngine.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
sceneSetup.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.