Panda3D
Public Member Functions | List of all members
WinStatsStripChart Class Reference

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

#include "winStatsStripChart.h"

Inheritance diagram for WinStatsStripChart:
PStatStripChart WinStatsGraph PStatGraph

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. More...
 
virtual void clicked_label (int collector_index)
 Called when the user single-clicks on a label. More...
 
virtual void force_redraw ()
 Called when it is necessary to redraw the entire graph. More...
 
virtual void new_collector (int collector_index)
 Called whenever a new Collector definition is received from the client. More...
 
virtual void new_data (int thread_index, int frame_number)
 Called as each frame's data is made available. More...
 
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. More...
 
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. More...
 
void set_vertical_scale (double value_height)
 Changes the value the height of the vertical axis represents. More...
 
- Public Member Functions inherited from PStatStripChart
 PStatStripChart (PStatMonitor *monitor, PStatView &view, int thread_index, int collector_index, int xsize, int ysize)
 
bool first_data () const
 Returns true if the chart has seen its first data appear on it, false if it is still a virgin chart. More...
 
bool get_average_mode () const
 Returns the current state of the average_mode flag. More...
 
int get_collector_index () const
 Returns the particular collector whose data this strip chart reflects. More...
 
int get_collector_under_pixel (int xpoint, int ypoint)
 Return the collector index associated with the particular band of color at the indicated pixel location, or -1 if no band of color was at the pixel. More...
 
double get_horizontal_scale () const
 Returns the amount of total time the width of the horizontal axis represents. More...
 
bool get_scroll_mode () const
 Returns the current state of the scroll_mode flag. More...
 
std::string get_title_text ()
 Returns the text suitable for the title label on the top line. More...
 
double get_vertical_scale () const
 Returns total value the height of the vertical axis represents. More...
 
PStatViewget_view () const
 Returns the View this chart represents. More...
 
int height_to_pixel (double value) const
 Converts a value (i.e. More...
 
bool is_title_unknown () const
 Returns true if get_title_text() has never yet returned an answer, false if it has. More...
 
void new_data (int frame_number)
 Indicates that new data has become available. More...
 
double pixel_to_height (int y) const
 Converts a vertical pixel offset to a value (a "height" in the strip chart). More...
 
double pixel_to_timestamp (int x) const
 Converts a horizontal pixel offset to a timestamp. More...
 
void set_auto_vertical_scale ()
 Sets the vertical scale to make all the data visible. More...
 
void set_average_mode (bool average_mode)
 Changes the average_mode flag. More...
 
void set_collector_index (int collector_index)
 Changes the collector represented by this strip chart. More...
 
void set_default_vertical_scale ()
 Sets the vertical scale according to the suggested scale of the base collector, if any, or to center the target frame rate bar otherwise. More...
 
void set_horizontal_scale (double time_width)
 Changes the amount of time the width of the horizontal axis represents. More...
 
void set_scroll_mode (bool scroll_mode)
 Changes the scroll_mode flag. More...
 
void set_vertical_scale (double value_height)
 Changes the value the height of the vertical axis represents. More...
 
int timestamp_to_pixel (double time) const
 Converts a timestamp to a horizontal pixel offset. More...
 
void update ()
 Updates the chart with the latest data. More...
 
- Public Member Functions inherited from PStatGraph
 PStatGraph (PStatMonitor *monitor, int xsize, int ysize)
 
int add_user_guide_bar (double height)
 Creates a new user guide bar and returns its index number. More...
 
int find_user_guide_bar (double from_height, double to_height) const
 Returns the index number of the first user guide bar found whose height is within the indicated range, or -1 if no user guide bars fall within the range. More...
 
const GuideBarget_guide_bar (int n) const
 Returns the nth horizontal guide bar. More...
 
const std::string & get_guide_bar_unit_name () const
 Returns the name of the units to be used for the guide bars if the units type is set to GBU_named | GBU_show_units. More...
 
int get_guide_bar_units () const
 Returns the units that are displayed for the guide bar labels. More...
 
int get_label_collector (int n) const
 Returns the collector index associated with the nth label. More...
 
LRGBColor get_label_color (int n) const
 Returns the color associated with the nth label. More...
 
std::string get_label_name (int n) const
 Returns the text associated with the nth label. More...
 
PStatMonitorget_monitor () const
 Returns the monitor associated with this chart. More...
 
int get_num_guide_bars () const
 Returns the number of horizontal guide bars that should be drawn, based on the indicated target frame rate. More...
 
int get_num_labels () const
 Returns the number of labels to be drawn for this chart. More...
 
int get_num_user_guide_bars () const
 Returns the current number of user-defined guide bars. More...
 
double get_target_frame_rate () const
 Returns the indicated target frame rate in Hz. More...
 
GuideBar get_user_guide_bar (int n) const
 Returns the nth user-defined guide bar. More...
 
int get_xsize () const
 Returns the width of the chart in pixels. More...
 
int get_ysize () const
 Returns the height of the chart in pixels. More...
 
void move_user_guide_bar (int n, double height)
 Adjusts the height of the nth user-defined guide bar. More...
 
void remove_user_guide_bar (int n)
 Removes the user guide bar with the indicated index number. More...
 
void set_guide_bar_unit_name (const std::string &unit_name)
 Sets the name of the units to be used for the guide bars if the units type is set to GBU_named | GBU_show_units. More...
 
void set_guide_bar_units (int unit_mask)
 Sets the units that are displayed for the guide bar labels. More...
 
void set_target_frame_rate (double frame_rate)
 Sets the target frame rate of the application in Hz. More...
 
- Public Member Functions inherited from WinStatsGraph
 WinStatsGraph (WinStatsMonitor *monitor)
 
void set_pause (bool pause)
 Changes the pause flag for the graph. More...
 
void user_guide_bars_changed ()
 Called when the user guide bars have been changed. More...
 

Additional Inherited Members

- Public Types inherited from PStatGraph
enum  GuideBarStyle { GBS_normal, GBS_target, GBS_user }
 
enum  GuideBarUnits { GBU_hz = 0x0001, GBU_ms = 0x0002, GBU_named = 0x0004, GBU_show_units = 0x0008 }
 
- Public Types inherited from WinStatsGraph
enum  DragMode {
  DM_none, DM_scale, DM_left_margin, DM_right_margin,
  DM_guide_bar, DM_new_guide_bar, DM_sizing
}
 
- Static Public Member Functions inherited from PStatGraph
static std::string format_number (double value)
 Returns a string representing the value nicely formatted for its range. More...
 
static std::string format_number (double value, int guide_bar_units, const std::string &unit_name=std::string())
 Returns a string representing the value nicely formatted for its range, including the units as indicated. More...
 

Detailed Description

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

Definition at line 30 of file winStatsStripChart.h.

Member Function Documentation

◆ changed_graph_size()

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 129 of file winStatsStripChart.cxx.

◆ clicked_label()

void WinStatsStripChart::clicked_label ( int  collector_index)
virtual

◆ force_redraw()

void WinStatsStripChart::force_redraw ( )
virtual

Called when it is necessary to redraw the entire graph.

Reimplemented from WinStatsGraph.

Definition at line 121 of file winStatsStripChart.cxx.

◆ new_collector()

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 84 of file winStatsStripChart.cxx.

References WinStatsGraph::new_collector().

◆ new_data()

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 95 of file winStatsStripChart.cxx.

References PStatStripChart::is_title_unknown().

◆ set_scroll_speed()

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 162 of file winStatsStripChart.cxx.

References PStatStripChart::set_horizontal_scale().

Referenced by WinStatsMonitor::open_strip_chart().

◆ set_time_units()

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 139 of file winStatsStripChart.cxx.

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

Referenced by WinStatsMonitor::open_strip_chart().

◆ set_vertical_scale()

void WinStatsStripChart::set_vertical_scale ( double  value_height)

Changes the value the height of the vertical axis represents.

This may force a redraw.

Definition at line 205 of file winStatsStripChart.cxx.

References PStatStripChart::set_vertical_scale().


The documentation for this class was generated from the following files: