Panda3D
sceneGraphAnalyzerMeter.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 sceneGraphAnalyzerMeter.I
10  * @author pratt
11  * @date 2007-02-14
12  */
13 
14 /**
15  * Returns the GraphicsOutput that was passed to setup_window(), or NULL if
16  * setup_window() has not been called.
17  */
19 get_window() const {
20  return _window;
21 }
22 
23 /**
24  * Returns the DisplayRegion that the meter has created to render itself into
25  * the window to setup_window(), or NULL if setup_window() has not been
26  * called.
27  */
29 get_display_region() const {
30  return _display_region;
31 }
32 
33 /**
34  * Specifies the number of seconds that should elapse between updates to the
35  * meter. This should be reasonably slow (e.g. 0.5 to 2.0) so that the
36  * calculation of the scene graph analysis does not itself dominate the frame
37  * rate.
38  */
40 set_update_interval(double update_interval) {
41  _update_interval = update_interval;
42 }
43 
44 /**
45  * Returns the number of seconds that will elapse between updates to the frame
46  * rate indication.
47  */
49 get_update_interval() const {
50  return _update_interval;
51 }
52 
53 /**
54  * Sets the node to be analyzed.
55  */
57 set_node(PandaNode *node) {
58  _node = node;
59 }
60 
61 /**
62  * Returns the node to be analyzed.
63  */
65 get_node() const {
66  return _node;
67 }
68 
69 /**
70  * You can call this to explicitly force the SceneGraphAnalyzerMeter to update
71  * itself with the latest scene graph analysis information. Normally, it is
72  * not necessary to call this explicitly.
73  */
75 update() {
76  Thread *current_thread = Thread::get_current_thread();
77  do_update(current_thread);
78 }
DisplayRegion
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:57
Thread::get_current_thread
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition: thread.h:109
SceneGraphAnalyzerMeter::get_node
PandaNode * get_node() const
Returns the node to be analyzed.
Definition: sceneGraphAnalyzerMeter.I:65
GraphicsOutput
This is a base class for the various different classes that represent the result of a frame of render...
Definition: graphicsOutput.h:63
SceneGraphAnalyzerMeter::get_display_region
DisplayRegion * get_display_region() const
Returns the DisplayRegion that the meter has created to render itself into the window to setup_window...
Definition: sceneGraphAnalyzerMeter.I:29
SceneGraphAnalyzerMeter::get_update_interval
double get_update_interval() const
Returns the number of seconds that will elapse between updates to the frame rate indication.
Definition: sceneGraphAnalyzerMeter.I:49
SceneGraphAnalyzerMeter::set_update_interval
void set_update_interval(double update_interval)
Specifies the number of seconds that should elapse between updates to the meter.
Definition: sceneGraphAnalyzerMeter.I:40
PandaNode
A basic node of the scene graph or data graph.
Definition: pandaNode.h:65
SceneGraphAnalyzerMeter::set_node
void set_node(PandaNode *node)
Sets the node to be analyzed.
Definition: sceneGraphAnalyzerMeter.I:57
Thread
A thread; that is, a lightweight process.
Definition: thread.h:46
SceneGraphAnalyzerMeter::update
void update()
You can call this to explicitly force the SceneGraphAnalyzerMeter to update itself with the latest sc...
Definition: sceneGraphAnalyzerMeter.I:75
SceneGraphAnalyzerMeter::get_window
GraphicsOutput * get_window() const
Returns the GraphicsOutput that was passed to setup_window(), or NULL if setup_window() has not been ...
Definition: sceneGraphAnalyzerMeter.I:19