Panda3D

sceneGraphAnalyzerMeter.I

00001 // Filename: sceneGraphAnalyzerMeter.I
00002 // Created by:  pratt (14Feb07)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: SceneGraphAnalyzerMeter::get_window
00018 //       Access: Published
00019 //  Description: Returns the GraphicsOutput that was passed to
00020 //               setup_window(), or NULL if setup_window() has not
00021 //               been called.
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE GraphicsOutput *SceneGraphAnalyzerMeter::
00024 get_window() const {
00025   return _window;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: SceneGraphAnalyzerMeter::get_display_region
00030 //       Access: Published
00031 //  Description: Returns the DisplayRegion that the meter has created
00032 //               to render itself into the window to setup_window(),
00033 //               or NULL if setup_window() has not been called.
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE DisplayRegion *SceneGraphAnalyzerMeter::
00036 get_display_region() const {
00037   return _display_region;
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: SceneGraphAnalyzerMeter::set_update_interval
00042 //       Access: Published
00043 //  Description: Specifies the number of seconds that should elapse
00044 //               between updates to the meter.  This should be
00045 //               reasonably slow (e.g. 0.5 to 2.0) so that the
00046 //               calculation of the scene graph analysis does not
00047 //               itself dominate the frame rate.
00048 ////////////////////////////////////////////////////////////////////
00049 INLINE void SceneGraphAnalyzerMeter::
00050 set_update_interval(double update_interval) {
00051   _update_interval = update_interval;
00052 }
00053 
00054 ////////////////////////////////////////////////////////////////////
00055 //     Function: SceneGraphAnalyzerMeter::get_update_interval
00056 //       Access: Published
00057 //  Description: Returns the number of seconds that will elapse
00058 //               between updates to the frame rate indication.
00059 ////////////////////////////////////////////////////////////////////
00060 INLINE double SceneGraphAnalyzerMeter::
00061 get_update_interval() const {
00062   return _update_interval;
00063 }
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //     Function: SceneGraphAnalyzerMeter::set_node
00067 //       Access: Published
00068 //  Description: Sets the node to be analyzed.
00069 ////////////////////////////////////////////////////////////////////
00070 INLINE void SceneGraphAnalyzerMeter::
00071 set_node(PandaNode *node) {
00072   _node = node;
00073 }
00074 
00075 ////////////////////////////////////////////////////////////////////
00076 //     Function: SceneGraphAnalyzerMeter::get_node
00077 //       Access: Published
00078 //  Description: Returns the node to be analyzed.
00079 ////////////////////////////////////////////////////////////////////
00080 INLINE PandaNode *SceneGraphAnalyzerMeter::
00081 get_node() const {
00082   return _node;
00083 }
00084 
00085 ////////////////////////////////////////////////////////////////////
00086 //     Function: SceneGraphAnalyzerMeter::update
00087 //       Access: Published
00088 //  Description: You can call this to explicitly force the
00089 //               SceneGraphAnalyzerMeter to update itself with the
00090 //               latest scene graph analysis information.
00091 //               Normally, it is not necessary to call this explicitly.
00092 ////////////////////////////////////////////////////////////////////
00093 INLINE void SceneGraphAnalyzerMeter::
00094 update() {
00095   Thread *current_thread = Thread::get_current_thread();
00096   do_update(current_thread);
00097 }
 All Classes Functions Variables Enumerations