Panda3D

winStatsStripChart.h

00001 // Filename: winStatsStripChart.h
00002 // Created by:  drose (03Dec03)
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 #ifndef WINSTATSSTRIPCHART_H
00016 #define WINSTATSSTRIPCHART_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "winStatsGraph.h"
00021 #include "pStatStripChart.h"
00022 #include "pointerTo.h"
00023 
00024 #include <windows.h>
00025 
00026 class WinStatsMonitor;
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : WinStatsStripChart
00030 // Description : A window that draws a strip chart, given a view.
00031 ////////////////////////////////////////////////////////////////////
00032 class WinStatsStripChart : public PStatStripChart, public WinStatsGraph {
00033 public:
00034   WinStatsStripChart(WinStatsMonitor *monitor,
00035                      int thread_index, int collector_index, bool show_level);
00036   virtual ~WinStatsStripChart();
00037 
00038   virtual void new_collector(int collector_index);
00039   virtual void new_data(int thread_index, int frame_number);
00040   virtual void force_redraw();
00041   virtual void changed_graph_size(int graph_xsize, int graph_ysize);
00042 
00043   virtual void set_time_units(int unit_mask);
00044   virtual void set_scroll_speed(double scroll_speed);
00045   virtual void clicked_label(int collector_index);
00046   void set_vertical_scale(double value_height);
00047 
00048 protected:
00049   virtual void update_labels();
00050 
00051   virtual void clear_region();
00052   virtual void copy_region(int start_x, int end_x, int dest_x);
00053   virtual void draw_slice(int x, int w, 
00054                           const PStatStripChart::FrameData &fdata);
00055   virtual void draw_empty(int x, int w);
00056   virtual void draw_cursor(int x);
00057   virtual void end_draw(int from_x, int to_x);
00058 
00059   LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
00060   virtual LONG graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
00061   virtual void additional_window_paint(HDC hdc);
00062   virtual void additional_graph_window_paint(HDC hdc);
00063   virtual DragMode consider_drag_start(int mouse_x, int mouse_y, 
00064                                        int width, int height);
00065   virtual void set_drag_mode(DragMode drag_mode);
00066   virtual void move_graph_window(int graph_left, int graph_top,
00067                                  int graph_xsize, int graph_ysize);
00068 
00069 private:
00070   void draw_guide_bar(HDC hdc, int from_x, int to_x, const GuideBar &bar);
00071   int draw_guide_label(HDC hdc, int x, const GuideBar &bar, int last_y);
00072   void create_window();
00073   static void register_window_class(HINSTANCE application);
00074 
00075   static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
00076 
00077   int _brush_origin;
00078   string _net_value_text;
00079 
00080   HWND _smooth_check_box;
00081   static size_t _check_box_height, _check_box_width;
00082 
00083   static bool _window_class_registered;
00084   static const char * const _window_class_name;
00085 };
00086 
00087 #endif
00088 
 All Classes Functions Variables Enumerations