Panda3D
winStatsStripChart.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file winStatsStripChart.h
10  * @author drose
11  * @date 2003-12-03
12  */
13 
14 #ifndef WINSTATSSTRIPCHART_H
15 #define WINSTATSSTRIPCHART_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "winStatsGraph.h"
20 #include "pStatStripChart.h"
21 #include "pointerTo.h"
22 
23 #ifndef WIN32_LEAN_AND_MEAN
24 #define WIN32_LEAN_AND_MEAN 1
25 #endif
26 #include <windows.h>
27 
28 class WinStatsMonitor;
29 
30 /**
31  * A window that draws a strip chart, given a view.
32  */
34 public:
36  int thread_index, int collector_index, bool show_level);
37  virtual ~WinStatsStripChart();
38 
39  virtual void new_collector(int collector_index);
40  virtual void new_data(int thread_index, int frame_number);
41  virtual void force_redraw();
42  virtual void changed_graph_size(int graph_xsize, int graph_ysize);
43 
44  virtual void set_time_units(int unit_mask);
45  virtual void set_scroll_speed(double scroll_speed);
46  virtual void clicked_label(int collector_index);
47  void set_vertical_scale(double value_height);
48 
49 protected:
50  virtual void update_labels();
51 
52  virtual void clear_region();
53  virtual void copy_region(int start_x, int end_x, int dest_x);
54  virtual void draw_slice(int x, int w,
55  const PStatStripChart::FrameData &fdata);
56  virtual void draw_empty(int x, int w);
57  virtual void draw_cursor(int x);
58  virtual void end_draw(int from_x, int to_x);
59 
60  LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
61  virtual LONG graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
62  virtual void additional_window_paint(HDC hdc);
63  virtual void additional_graph_window_paint(HDC hdc);
64  virtual DragMode consider_drag_start(int mouse_x, int mouse_y,
65  int width, int height);
66  virtual void set_drag_mode(DragMode drag_mode);
67  virtual void move_graph_window(int graph_left, int graph_top,
68  int graph_xsize, int graph_ysize);
69 
70 private:
71  void draw_guide_bar(HDC hdc, int from_x, int to_x, const GuideBar &bar);
72  int draw_guide_label(HDC hdc, int x, const GuideBar &bar, int last_y);
73  void create_window();
74  static void register_window_class(HINSTANCE application);
75 
76  static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
77 
78  int _brush_origin;
79  std::string _net_value_text;
80 
81  HWND _smooth_check_box;
82  static size_t _check_box_height, _check_box_width;
83 
84  static bool _window_class_registered;
85  static const char * const _window_class_name;
86 };
87 
88 #endif
WinStatsStripChart::new_data
virtual void new_data(int thread_index, int frame_number)
Called as each frame's data is made available.
Definition: winStatsStripChart.cxx:95
pStatStripChart.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector
This is our own Panda specialization on the default STL vector.
Definition: pvector.h:42
WinStatsStripChart::set_time_units
virtual void set_time_units(int unit_mask)
Called when the user selects a new time units from the monitor pulldown menu, this should adjust the ...
Definition: winStatsStripChart.cxx:139
WinStatsStripChart::force_redraw
virtual void force_redraw()
Called when it is necessary to redraw the entire graph.
Definition: winStatsStripChart.cxx:121
PStatStripChart
This is an abstract class that presents the interface for drawing a basic strip-chart,...
Definition: pStatStripChart.h:38
WinStatsStripChart::new_collector
virtual void new_collector(int collector_index)
Called whenever a new Collector definition is received from the client.
Definition: winStatsStripChart.cxx:84
WinStatsStripChart::set_scroll_speed
virtual void set_scroll_speed(double scroll_speed)
Called when the user selects a new scroll speed from the monitor pulldown menu, this should adjust th...
Definition: winStatsStripChart.cxx:162
WinStatsStripChart
A window that draws a strip chart, given a view.
Definition: winStatsStripChart.h:33
WinStatsStripChart::set_vertical_scale
void set_vertical_scale(double value_height)
Changes the value the height of the vertical axis represents.
Definition: winStatsStripChart.cxx:205
PStatGraph::GuideBar
Definition: pStatGraph.h:57
WinStatsGraph
This is just an abstract base class to provide a common pointer type for the various kinds of graphs ...
Definition: winStatsGraph.h:32
WinStatsStripChart::changed_graph_size
virtual void changed_graph_size(int graph_xsize, int graph_ysize)
Called when the user has resized the window, forcing a resize of the graph.
Definition: winStatsStripChart.cxx:129
winStatsGraph.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
WinStatsMonitor
This class represents a connection to a PStatsClient and manages the data exchange with the client.
Definition: winStatsMonitor.h:38
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
WinStatsStripChart::clicked_label
virtual void clicked_label(int collector_index)
Called when the user single-clicks on a label.
Definition: winStatsStripChart.cxx:173