Panda3D
Public Member Functions | Protected Member Functions
WinStatsStripChart Class Reference

A window that draws a strip chart, given a view. More...

#include "winStatsStripChart.h"

Inheritance diagram for WinStatsStripChart:
PStatStripChart WinStatsGraph PStatGraph

List of all members.

Public Member Functions

 WinStatsStripChart (WinStatsMonitor *monitor, int thread_index, int collector_index, bool show_level)
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.
virtual void clicked_label (int collector_index)
 Called when the user single-clicks on a label.
virtual void force_redraw ()
 Called when it is necessary to redraw the entire graph.
virtual void new_collector (int collector_index)
 Called whenever a new Collector definition is received from the client.
virtual void new_data (int thread_index, int frame_number)
 Called as each frame's data is made available.
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 the speed for the graph to the indicated value.
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 units for the graph to the indicated mask if it is a time-based graph.
void set_vertical_scale (double value_height)
 Changes the value the height of the vertical axis represents.

Protected Member Functions

virtual void additional_graph_window_paint (HDC hdc)
 This is called during the servicing of WM_PAINT; it gives a derived class opportunity to do some further painting into the window (the outer window, not the graph window).
virtual void additional_window_paint (HDC hdc)
 This is called during the servicing of WM_PAINT; it gives a derived class opportunity to do some further painting into the window (the outer window, not the graph window).
virtual void clear_region ()
 Erases the chart area.
virtual DragMode consider_drag_start (int mouse_x, int mouse_y, int width, int height)
 Based on the mouse position within the window's client area, look for draggable things the mouse might be hovering over and return the apprioprate DragMode enum or DM_none if nothing is indicated.
virtual void copy_region (int start_x, int end_x, int dest_x)
 Should be overridden by the user class to copy a region of the chart from one part of the chart to another.
virtual void draw_cursor (int x)
 Draws a single vertical slice of foreground color.
virtual void draw_empty (int x, int w)
 Draws a single vertical slice of background color.
virtual void draw_slice (int x, int w, const PStatStripChart::FrameData &fdata)
 Draws a single vertical slice of the strip chart, at the given pixel position, and corresponding to the indicated level data.
virtual void end_draw (int from_x, int to_x)
 Should be overridden by the user class.
virtual LONG graph_window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
virtual void move_graph_window (int graph_left, int graph_top, int graph_xsize, int graph_ysize)
 Repositions the graph child window within the parent window according to the _margin variables.
virtual void set_drag_mode (DragMode drag_mode)
 This should be called whenever the drag mode needs to change state.
virtual void update_labels ()
 Resets the list of labels.
LONG window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 This window_proc should be called up to by the derived classes for any messages that are not specifically handled by the derived class.

Detailed Description

A window that draws a strip chart, given a view.

Definition at line 32 of file winStatsStripChart.h.


Member Function Documentation

void WinStatsStripChart::additional_graph_window_paint ( HDC  hdc) [protected, virtual]

This is called during the servicing of WM_PAINT; it gives a derived class opportunity to do some further painting into the window (the outer window, not the graph window).

Reimplemented from WinStatsGraph.

Definition at line 583 of file winStatsStripChart.cxx.

References PStatGraph::get_num_user_guide_bars(), PStatGraph::get_user_guide_bar(), and PStatGraph::get_xsize().

void WinStatsStripChart::additional_window_paint ( HDC  hdc) [protected, virtual]

This is called during the servicing of WM_PAINT; it gives a derived class opportunity to do some further painting into the window (the outer window, not the graph window).

Reimplemented from WinStatsGraph.

Definition at line 533 of file winStatsStripChart.cxx.

References PStatGraph::get_guide_bar(), PStatGraph::get_num_guide_bars(), PStatGraph::get_num_user_guide_bars(), PStatGraph::get_user_guide_bar(), PStatStripChart::get_vertical_scale(), and PStatGraph::make_guide_bar().

void WinStatsStripChart::changed_graph_size ( int  graph_xsize,
int  graph_ysize 
) [virtual]

Called when the user has resized the window, forcing a resize of the graph.

Reimplemented from WinStatsGraph.

Definition at line 143 of file winStatsStripChart.cxx.

References PStatStripChart::changed_size().

void WinStatsStripChart::clear_region ( ) [protected, virtual]

Erases the chart area.

Reimplemented from PStatStripChart.

Definition at line 261 of file winStatsStripChart.cxx.

References PStatGraph::get_xsize(), and PStatGraph::get_ysize().

void WinStatsStripChart::clicked_label ( int  collector_index) [virtual]
WinStatsGraph::DragMode WinStatsStripChart::consider_drag_start ( int  mouse_x,
int  mouse_y,
int  width,
int  height 
) [protected, virtual]

Based on the mouse position within the window's client area, look for draggable things the mouse might be hovering over and return the apprioprate DragMode enum or DM_none if nothing is indicated.

Reimplemented from WinStatsGraph.

Definition at line 599 of file winStatsStripChart.cxx.

References PStatGraph::find_user_guide_bar(), PStatGraph::get_xsize(), PStatGraph::get_ysize(), and PStatStripChart::pixel_to_height().

void WinStatsStripChart::copy_region ( int  start_x,
int  end_x,
int  dest_x 
) [protected, virtual]

Should be overridden by the user class to copy a region of the chart from one part of the chart to another.

This is used to implement scrolling.

Reimplemented from PStatStripChart.

Definition at line 274 of file winStatsStripChart.cxx.

References PStatGraph::get_ysize().

void WinStatsStripChart::draw_cursor ( int  x) [protected, virtual]

Draws a single vertical slice of foreground color.

Reimplemented from PStatStripChart.

Definition at line 348 of file winStatsStripChart.cxx.

References PStatGraph::get_ysize().

void WinStatsStripChart::draw_empty ( int  x,
int  w 
) [protected, virtual]

Draws a single vertical slice of background color.

Reimplemented from PStatStripChart.

Definition at line 337 of file winStatsStripChart.cxx.

References PStatGraph::get_ysize().

void WinStatsStripChart::draw_slice ( int  x,
int  w,
const PStatStripChart::FrameData &  fdata 
) [protected, virtual]

Draws a single vertical slice of the strip chart, at the given pixel position, and corresponding to the indicated level data.

Reimplemented from PStatStripChart.

Definition at line 299 of file winStatsStripChart.cxx.

References WinStatsGraph::get_collector_brush(), PStatStripChart::get_vertical_scale(), PStatGraph::get_ysize(), and PStatStripChart::height_to_pixel().

void WinStatsStripChart::end_draw ( int  from_x,
int  to_x 
) [protected, virtual]

Should be overridden by the user class.

This hook will be called after drawing a series of color bars in the strip chart; it gives the pixel range that was just redrawn.

Reimplemented from PStatStripChart.

Definition at line 362 of file winStatsStripChart.cxx.

References PStatGraph::get_guide_bar(), PStatGraph::get_num_guide_bars(), and PStatGraph::get_ysize().

Called when it is necessary to redraw the entire graph.

Reimplemented from PStatStripChart.

Definition at line 132 of file winStatsStripChart.cxx.

void WinStatsStripChart::move_graph_window ( int  graph_left,
int  graph_top,
int  graph_xsize,
int  graph_ysize 
) [protected, virtual]

Repositions the graph child window within the parent window according to the _margin variables.

Reimplemented from WinStatsGraph.

Definition at line 656 of file winStatsStripChart.cxx.

void WinStatsStripChart::new_collector ( int  collector_index) [virtual]

Called whenever a new Collector definition is received from the client.

Reimplemented from WinStatsGraph.

Definition at line 90 of file winStatsStripChart.cxx.

void WinStatsStripChart::new_data ( int  thread_index,
int  frame_number 
) [virtual]

Called as each frame's data is made available.

There is no gurantee the frames will arrive in order, or that all of them will arrive at all. The monitor should be prepared to accept frames received out-of-order or missing.

Reimplemented from WinStatsGraph.

Definition at line 104 of file winStatsStripChart.cxx.

References PStatGraph::format_number(), PStatStripChart::get_average_net_value(), PStatGraph::get_guide_bar_unit_name(), PStatGraph::get_guide_bar_units(), PStatStripChart::get_title_text(), PStatStripChart::is_title_unknown(), and PStatStripChart::update().

void WinStatsStripChart::set_drag_mode ( WinStatsGraph::DragMode  drag_mode) [protected, virtual]

This should be called whenever the drag mode needs to change state.

It provides hooks for a derived class to do something special.

Reimplemented from WinStatsGraph.

Definition at line 629 of file winStatsStripChart.cxx.

References PStatStripChart::set_average_mode().

Referenced by window_proc().

void WinStatsStripChart::set_scroll_speed ( double  scroll_speed) [virtual]

Called when the user selects a new scroll speed from the monitor pulldown menu, this should adjust the speed for the graph to the indicated value.

Reimplemented from WinStatsGraph.

Definition at line 182 of file winStatsStripChart.cxx.

References PStatStripChart::set_horizontal_scale().

Referenced by WinStatsMonitor::open_strip_chart().

void WinStatsStripChart::set_time_units ( int  unit_mask) [virtual]

Called when the user selects a new time units from the monitor pulldown menu, this should adjust the units for the graph to the indicated mask if it is a time-based graph.

Reimplemented from WinStatsGraph.

Definition at line 156 of file winStatsStripChart.cxx.

References PStatGraph::get_guide_bar_units(), and PStatGraph::set_guide_bar_units().

Referenced by WinStatsMonitor::open_strip_chart().

void WinStatsStripChart::set_vertical_scale ( double  value_height)

Changes the value the height of the vertical axis represents.

This may force a redraw.

Reimplemented from PStatStripChart.

Definition at line 229 of file winStatsStripChart.cxx.

void WinStatsStripChart::update_labels ( ) [protected, virtual]
LONG WinStatsStripChart::window_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
) [protected]

This window_proc should be called up to by the derived classes for any messages that are not specifically handled by the derived class.

Reimplemented from WinStatsGraph.

Definition at line 381 of file winStatsStripChart.cxx.

References PStatStripChart::set_average_mode(), and set_drag_mode().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations