00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef SCENEGRAPHANALYZERMETER_H
00016 #define SCENEGRAPHANALYZERMETER_H
00017
00018 #include "pandabase.h"
00019 #include "textNode.h"
00020 #include "nodePath.h"
00021 #include "graphicsOutput.h"
00022 #include "displayRegion.h"
00023 #include "pointerTo.h"
00024 #include "sceneGraphAnalyzer.h"
00025 #include "pStatCollector.h"
00026
00027 class PandaNode;
00028 class GraphicsChannel;
00029 class ClockObject;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 class EXPCL_PANDA SceneGraphAnalyzerMeter : public TextNode {
00044 PUBLISHED:
00045 SceneGraphAnalyzerMeter(const string &name, PandaNode *node);
00046 virtual ~SceneGraphAnalyzerMeter();
00047
00048 void setup_window(GraphicsOutput *window);
00049 void clear_window();
00050
00051 INLINE GraphicsOutput *get_window() const;
00052 INLINE DisplayRegion *get_display_region() const;
00053
00054 INLINE void set_update_interval(double update_interval);
00055 INLINE double get_update_interval() const;
00056
00057 INLINE void set_node(PandaNode *node);
00058 INLINE PandaNode *get_node() const;
00059
00060 INLINE void update();
00061
00062 protected:
00063 virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
00064
00065 private:
00066 void do_update(Thread *current_thread);
00067
00068 private:
00069 PT(GraphicsOutput) _window;
00070 PT(DisplayRegion) _display_region;
00071 NodePath _root;
00072 SceneGraphAnalyzer _scene_graph_analyzer;
00073
00074 double _update_interval;
00075 double _last_update;
00076 PandaNode *_node;
00077 ClockObject *_clock_object;
00078
00079 static PStatCollector _show_analyzer_pcollector;
00080
00081 public:
00082 static TypeHandle get_class_type() {
00083 return _type_handle;
00084 }
00085 static void init_type() {
00086 TextNode::init_type();
00087 register_type(_type_handle, "SceneGraphAnalyzerMeter",
00088 TextNode::get_class_type());
00089 }
00090 virtual TypeHandle get_type() const {
00091 return get_class_type();
00092 }
00093 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00094
00095 private:
00096 static TypeHandle _type_handle;
00097 };
00098
00099 #include "sceneGraphAnalyzerMeter.I"
00100
00101 #endif