Panda3D
sceneGraphAnalyzerMeter.I
1 // Filename: sceneGraphAnalyzerMeter.I
2 // Created by: pratt (14Feb07)
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: SceneGraphAnalyzerMeter::get_window
18 // Access: Published
19 // Description: Returns the GraphicsOutput that was passed to
20 // setup_window(), or NULL if setup_window() has not
21 // been called.
22 ////////////////////////////////////////////////////////////////////
24 get_window() const {
25  return _window;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: SceneGraphAnalyzerMeter::get_display_region
30 // Access: Published
31 // Description: Returns the DisplayRegion that the meter has created
32 // to render itself into the window to setup_window(),
33 // or NULL if setup_window() has not been called.
34 ////////////////////////////////////////////////////////////////////
37  return _display_region;
38 }
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: SceneGraphAnalyzerMeter::set_update_interval
42 // Access: Published
43 // Description: Specifies the number of seconds that should elapse
44 // between updates to the meter. This should be
45 // reasonably slow (e.g. 0.5 to 2.0) so that the
46 // calculation of the scene graph analysis does not
47 // itself dominate the frame rate.
48 ////////////////////////////////////////////////////////////////////
49 INLINE void SceneGraphAnalyzerMeter::
50 set_update_interval(double update_interval) {
51  _update_interval = update_interval;
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: SceneGraphAnalyzerMeter::get_update_interval
56 // Access: Published
57 // Description: Returns the number of seconds that will elapse
58 // between updates to the frame rate indication.
59 ////////////////////////////////////////////////////////////////////
60 INLINE double SceneGraphAnalyzerMeter::
62  return _update_interval;
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: SceneGraphAnalyzerMeter::set_node
67 // Access: Published
68 // Description: Sets the node to be analyzed.
69 ////////////////////////////////////////////////////////////////////
70 INLINE void SceneGraphAnalyzerMeter::
72  _node = node;
73 }
74 
75 ////////////////////////////////////////////////////////////////////
76 // Function: SceneGraphAnalyzerMeter::get_node
77 // Access: Published
78 // Description: Returns the node to be analyzed.
79 ////////////////////////////////////////////////////////////////////
81 get_node() const {
82  return _node;
83 }
84 
85 ////////////////////////////////////////////////////////////////////
86 // Function: SceneGraphAnalyzerMeter::update
87 // Access: Published
88 // Description: You can call this to explicitly force the
89 // SceneGraphAnalyzerMeter to update itself with the
90 // latest scene graph analysis information.
91 // Normally, it is not necessary to call this explicitly.
92 ////////////////////////////////////////////////////////////////////
93 INLINE void SceneGraphAnalyzerMeter::
94 update() {
95  Thread *current_thread = Thread::get_current_thread();
96  do_update(current_thread);
97 }
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
void update()
You can call this to explicitly force the SceneGraphAnalyzerMeter to update itself with the latest sc...
GraphicsOutput * get_window() const
Returns the GraphicsOutput that was passed to setup_window(), or NULL if setup_window() has not been ...
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
Definition: thread.I:145
PandaNode * get_node() const
Returns the node to be analyzed.
This is a base class for the various different classes that represent the result of a frame of render...
DisplayRegion * get_display_region() const
Returns the DisplayRegion that the meter has created to render itself into the window to setup_window...
void set_node(PandaNode *node)
Sets the node to be analyzed.
A thread; that is, a lightweight process.
Definition: thread.h:51
void set_update_interval(double update_interval)
Specifies the number of seconds that should elapse between updates to the meter.
double get_update_interval() const
Returns the number of seconds that will elapse between updates to the frame rate indication.
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:61