This is a special TextNode that automatically updates itself with output from a SceneGraphAnalyzer instance. More...

#include "sceneGraphAnalyzerMeter.h"

Inheritance diagram for SceneGraphAnalyzerMeter:
TextNode PandaNode TextEncoder TextProperties TypedWritable Namable LinkedListNode ReferenceCount TypedObject MemoryBase MemoryBase MemoryBase

List of all members.

Public Member Functions

 SceneGraphAnalyzerMeter (const string &name, PandaNode *node)
void clear_window ()
 Undoes the effect of a previous call to setup_window().
virtual TypeHandle force_init_type ()
DisplayRegionget_display_region () const
 Returns the DisplayRegion that the meter has created to render itself into the window to setup_window(), or NULL if setup_window() has not been called.
PandaNodeget_node () const
 Returns the node to be analyzed.
virtual TypeHandle get_type () const
double get_update_interval () const
 Returns the number of seconds that will elapse between updates to the frame rate indication.
GraphicsOutputget_window () const
 Returns the GraphicsOutput that was passed to setup_window(), or NULL if setup_window() has not been called.
void set_node (PandaNode *node)
 Sets the node to be analyzed.
void set_update_interval (double update_interval)
 Specifies the number of seconds that should elapse between updates to the meter.
void setup_window (GraphicsOutput *window)
 Sets up the frame rate meter to create a DisplayRegion to render itself into the indicated window.
void update ()
 You can call this to explicitly force the SceneGraphAnalyzerMeter to update itself with the latest scene graph analysis information.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

virtual bool cull_callback (CullTraverser *trav, CullTraverserData &data)
 This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

Detailed Description

This is a special TextNode that automatically updates itself with output from a SceneGraphAnalyzer instance.

It can be placed anywhere in the world where you'd like to see the output from SceneGraphAnalyzer.

It also has a special mode in which it may be attached directly to a channel or window. If this is done, it creates a DisplayRegion for itself and renders itself in the upper-right-hand corner.

Definition at line 43 of file sceneGraphAnalyzerMeter.h.


Member Function Documentation

Undoes the effect of a previous call to setup_window().

Definition at line 118 of file sceneGraphAnalyzerMeter.cxx.

Referenced by setup_window().

bool SceneGraphAnalyzerMeter::cull_callback ( CullTraverser trav,
CullTraverserData data 
) [protected, virtual]

This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.

Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.

By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.

The return value is true if this node should be visible, or false if it should be culled.

Reimplemented from TextNode.

Definition at line 153 of file sceneGraphAnalyzerMeter.cxx.

References CullTraverser::get_current_thread(), and ClockObject::get_frame_time().

Returns the DisplayRegion that the meter has created to render itself into the window to setup_window(), or NULL if setup_window() has not been called.

Definition at line 36 of file sceneGraphAnalyzerMeter.I.

Returns the node to be analyzed.

Definition at line 81 of file sceneGraphAnalyzerMeter.I.

Returns the number of seconds that will elapse between updates to the frame rate indication.

Definition at line 61 of file sceneGraphAnalyzerMeter.I.

Returns the GraphicsOutput that was passed to setup_window(), or NULL if setup_window() has not been called.

Definition at line 24 of file sceneGraphAnalyzerMeter.I.

void SceneGraphAnalyzerMeter::set_node ( PandaNode node) [inline]

Sets the node to be analyzed.

Definition at line 71 of file sceneGraphAnalyzerMeter.I.

void SceneGraphAnalyzerMeter::set_update_interval ( double  update_interval) [inline]

Specifies the number of seconds that should elapse between updates to the meter.

This should be reasonably slow (e.g. 0.5 to 2.0) so that the calculation of the scene graph analysis does not itself dominate the frame rate.

Definition at line 50 of file sceneGraphAnalyzerMeter.I.

Sets up the frame rate meter to create a DisplayRegion to render itself into the indicated window.

Definition at line 73 of file sceneGraphAnalyzerMeter.cxx.

References NodePath::attach_new_node(), clear_window(), NodePath::node(), PandaNode::set_attrib(), Lens::set_film_size(), NodePath::set_material_off(), and NodePath::set_two_sided().

You can call this to explicitly force the SceneGraphAnalyzerMeter to update itself with the latest scene graph analysis information.

Normally, it is not necessary to call this explicitly.

Reimplemented from TextNode.

Definition at line 94 of file sceneGraphAnalyzerMeter.I.

References Thread::get_current_thread().


The documentation for this class was generated from the following files: