mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
implement averaging (smoothing)
This commit is contained in:
parent
88743dab4d
commit
89006b755f
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
using Gtk::Menu_Helpers::MenuElem;
|
using Gtk::Menu_Helpers::MenuElem;
|
||||||
|
using Gtk::Menu_Helpers::CheckMenuElem;
|
||||||
using Gtk::Menu_Helpers::SeparatorElem;
|
using Gtk::Menu_Helpers::SeparatorElem;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -45,6 +46,7 @@ GtkStatsStripWindow(GtkStatsMonitor *monitor, int thread_index,
|
|||||||
{
|
{
|
||||||
_title_unknown = false;
|
_title_unknown = false;
|
||||||
_setup_scale_menu = false;
|
_setup_scale_menu = false;
|
||||||
|
_smooth = false;
|
||||||
|
|
||||||
setup_menu();
|
setup_menu();
|
||||||
layout_window(chart_xsize, chart_ysize);
|
layout_window(chart_xsize, chart_ysize);
|
||||||
@ -173,8 +175,11 @@ setup_menu() {
|
|||||||
|
|
||||||
_menu->items().push_back(MenuElem("Speed", *manage(speed_menu)));
|
_menu->items().push_back(MenuElem("Speed", *manage(speed_menu)));
|
||||||
|
|
||||||
|
|
||||||
_scale_menu = new Gtk::Menu;
|
_scale_menu = new Gtk::Menu;
|
||||||
|
_scale_menu->items().push_back
|
||||||
|
(CheckMenuElem("Smooth",
|
||||||
|
slot(this, &GtkStatsStripWindow::menu_smooth)));
|
||||||
|
_scale_menu->items().push_back(SeparatorElem());
|
||||||
_scale_menu->items().push_back
|
_scale_menu->items().push_back
|
||||||
(MenuElem("Auto scale",
|
(MenuElem("Auto scale",
|
||||||
slot(this, &GtkStatsStripWindow::menu_auto_vscale)));
|
slot(this, &GtkStatsStripWindow::menu_auto_vscale)));
|
||||||
@ -296,6 +301,18 @@ menu_vscale(float max_height) {
|
|||||||
_chart->set_vertical_scale(max_height);
|
_chart->set_vertical_scale(max_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: GtkStatsStripWindow::menu_smooth
|
||||||
|
// Access: Protected
|
||||||
|
// Description: Toggles the "smooth" state of the check menu.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void GtkStatsStripWindow::
|
||||||
|
menu_smooth() {
|
||||||
|
_smooth = !_smooth;
|
||||||
|
|
||||||
|
_chart->set_average_mode(_smooth);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: GtkStatsStripWindow::menu_auto_vscale
|
// Function: GtkStatsStripWindow::menu_auto_vscale
|
||||||
// Access: Protected
|
// Access: Protected
|
||||||
|
@ -47,6 +47,7 @@ protected:
|
|||||||
virtual void menu_new_window();
|
virtual void menu_new_window();
|
||||||
void menu_hscale(float wpm);
|
void menu_hscale(float wpm);
|
||||||
void menu_vscale(float max_height);
|
void menu_vscale(float max_height);
|
||||||
|
void menu_smooth();
|
||||||
void menu_auto_vscale();
|
void menu_auto_vscale();
|
||||||
void menu_show_levels(int collector_index);
|
void menu_show_levels(int collector_index);
|
||||||
void open_subchart(int collector_index);
|
void open_subchart(int collector_index);
|
||||||
@ -68,6 +69,8 @@ private:
|
|||||||
|
|
||||||
Gtk::Menu *_scale_menu;
|
Gtk::Menu *_scale_menu;
|
||||||
Gtk::Menu *_levels_menu;
|
Gtk::Menu *_levels_menu;
|
||||||
|
|
||||||
|
bool _smooth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user