14 #ifndef PSTATSTRIPCHART_H 15 #define PSTATSTRIPCHART_H 41 int thread_index,
int collector_index,
int xsize,
int ysize);
77 unsigned short _collector_index;
84 static void accumulate_frame_data(
FrameData &fdata,
85 const FrameData &additional,
double weight);
86 static void scale_frame_data(
FrameData &fdata,
double factor);
88 const FrameData &get_frame_data(
int frame_number);
90 int &then_i,
int &now_i,
double now);
91 double get_net_value(
int frame_number)
const;
92 double get_average_net_value()
const;
94 void changed_size(
int xsize,
int ysize);
97 virtual void update_labels();
98 virtual void normal_guide_bars();
100 virtual void clear_region();
101 virtual void copy_region(
int start_x,
int end_x,
int dest_x);
102 virtual void begin_draw(
int from_x,
int to_x);
103 virtual void draw_slice(
int x,
int w,
const FrameData &fdata);
104 virtual void draw_empty(
int x,
int w);
105 virtual void draw_cursor(
int x);
106 virtual void end_draw(
int from_x,
int to_x);
109 INLINE
bool is_label_used(
int collector_index)
const;
112 void draw_frames(
int first_frame,
int last_frame);
113 void draw_pixels(
int first_pixel,
int last_pixel);
115 void clear_label_usage();
116 void dec_label_usage(
const FrameData &fdata);
117 void inc_label_usage(
const FrameData &fdata);
124 int _collector_index;
138 double _value_height;
141 typedef vector_int LabelUsage;
142 LabelUsage _label_usage;
void set_horizontal_scale(double time_width)
Changes the amount of time the width of the horizontal axis represents.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_auto_vertical_scale()
Sets the vertical scale to make all the data visible.
double get_horizontal_scale() const
Returns the amount of total time the width of the horizontal axis represents.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void new_data(int frame_number)
Indicates that new data has become available.
int timestamp_to_pixel(double time) const
Converts a timestamp to a horizontal pixel offset.
void set_vertical_scale(double value_height)
Changes the value the height of the vertical axis represents.
This is an abstract base class for several different kinds of graphs that have a few things in common...
double pixel_to_height(int y) const
Converts a vertical pixel offset to a value (a "height" in the strip chart).
This is an abstract class that presents the interface for drawing a basic strip-chart,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_collector_under_pixel(int xpoint, int ypoint)
Return the collector index associated with the particular band of color at the indicated pixel locati...
This is our own Panda specialization on the default STL vector.
int get_collector_index() const
Returns the particular collector whose data this strip chart reflects.
This is an abstract class that presents the interface to any number of different front-ends for the s...
PStatView & get_view() const
Returns the View this chart represents.
void update()
Updates the chart with the latest data.
int height_to_pixel(double value) const
Converts a value (i.e.
A View boils down the frame data to a linear list of times spent in a number of different Collectors,...
bool get_average_mode() const
Returns the current state of the average_mode flag.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool is_title_unknown() const
Returns true if get_title_text() has never yet returned an answer, false if it has.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
double pixel_to_timestamp(int x) const
Converts a horizontal pixel offset to a timestamp.
void set_average_mode(bool average_mode)
Changes the average_mode flag.
void set_collector_index(int collector_index)
Changes the collector represented by this strip chart.
double get_vertical_scale() const
Returns total value the height of the vertical axis represents.
void set_default_vertical_scale()
Sets the vertical scale according to the suggested scale of the base collector, if any,...
bool get_scroll_mode() const
Returns the current state of the scroll_mode flag.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_scroll_mode(bool scroll_mode)
Changes the scroll_mode flag.
std::string get_title_text()
Returns the text suitable for the title label on the top line.