Panda3D

Loading...
Searching...
No Matches
winStatsPianoRoll.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 winStatsPianoRoll.h
10 * @author drose
11 * @date 2004-01-12
12 */
13
14#ifndef WINSTATSPIANOROLL_H
15#define WINSTATSPIANOROLL_H
16
17#include "pandatoolbase.h"
18
19#include "winStatsGraph.h"
20#include "pStatPianoRoll.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 piano-roll style chart, which shows the collectors
32 * explicitly stopping and starting, one frame at a time.
33 */
34 class WinStatsPianoRoll : public PStatPianoRoll, public WinStatsGraph {
35 public:
36 WinStatsPianoRoll(WinStatsMonitor *monitor, int thread_index);
37 virtual ~WinStatsPianoRoll();
38
39 virtual void new_data(int thread_index, int frame_number);
40 virtual void force_redraw();
41 virtual void changed_graph_size(int graph_xsize, int graph_ysize);
42
43 virtual void set_time_units(int unit_mask);
44 virtual void clicked_label(int collector_index);
45 void set_horizontal_scale(double time_width);
46
47 protected:
48 void clear_region();
49 virtual void begin_draw();
50 virtual void draw_bar(int row, int from_x, int to_x);
51 virtual void end_draw();
52 virtual void idle();
53
54 LONG window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
55 virtual LONG graph_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
56 virtual void additional_window_paint(HDC hdc);
57 virtual void additional_graph_window_paint(HDC hdc);
58 virtual DragMode consider_drag_start(int mouse_x, int mouse_y,
59 int width, int height);
60
61 private:
62 int get_collector_under_pixel(int xpoint, int ypoint);
63 void update_labels();
64 void draw_guide_bar(HDC hdc, const GuideBar &bar);
65 void draw_guide_label(HDC hdc, int y, const PStatGraph::GuideBar &bar);
66
67 void create_window();
68 static void register_window_class(HINSTANCE application);
69
70 static LONG WINAPI static_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
71
72 static bool _window_class_registered;
73 static const char * const _window_class_name;
74};
75
76#endif
PStatGraph::GuideBar
Definition pStatGraph.h:57
WinStatsMonitor
This class represents a connection to a PStatsClient and manages the data exchange with the client.
Definition winStatsMonitor.h:38
WinStatsPianoRoll::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 winStatsPianoRoll.cxx:78
WinStatsPianoRoll::set_horizontal_scale
void set_horizontal_scale(double time_width)
Changes the amount of time the width of the horizontal axis represents.
Definition winStatsPianoRoll.cxx:117
WinStatsPianoRoll::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 winStatsPianoRoll.cxx:88
WinStatsPianoRoll::clicked_label
virtual void clicked_label(int collector_index)
Called when the user single-clicks on a label.
Definition winStatsPianoRoll.cxx:106
WinStatsPianoRoll::new_data
virtual void new_data(int thread_index, int frame_number)
Called as each frame's data is made available.
Definition winStatsPianoRoll.cxx:60
WinStatsPianoRoll::force_redraw
virtual void force_redraw()
Called when it is necessary to redraw the entire graph.
Definition winStatsPianoRoll.cxx:70
pStatPianoRoll.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
winStatsGraph.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.