comparison libinterp/corefcn/graphics.cc @ 18961:52e01aa1fe8b

Overhaul FLTK pan, rotate, zoom * graphics.in.h: add axes properties pan, rotate3d, mouse_wheel_zoom and custom set_pan which disables rotate3d. * graphics.cc: add custom set_rotate3d and link with pan property. Disable rotate3d for 2D plots. * __init_fltk__.cc: replace gui_mode and mouse_wheel_zoom with axes properties pan, rotate3d and mouse_wheel_zoom. Disable pan for legends, move them instead. * __add_default_menu__.m: Add new menu entries for new pan and zoom modes. * findall.m: Update test for added uimenus. Each axes now has its own properties for interactive GUI control of pan, rotate3d and mouse_wheel_zoom. Now it's possible to have several figures and set pan for the 2D plot in figure x and rotate3d for the 3D plot in figure y. There are two new pan modes: "Pan x only" and "Pan y only". The toolbar buttons "P" and "R" set pan and rotate3d for the last clicked axes object or the object below the center of the canvas if none was clicked yet. The legend can now be moved with the mouse.
author Andreas Weber <andy.weber.aw@gmail.com>
date Sun, 27 Jul 2014 22:31:14 +0200
parents c66029adf853
children d4b69559a0f7
comparison
equal deleted inserted replaced
18959:4c45986a278e 18961:52e01aa1fe8b
6386 linestyleorder.set (convert_linestyleorder_string (v), false); 6386 linestyleorder.set (convert_linestyleorder_string (v), false);
6387 } 6387 }
6388 } 6388 }
6389 6389
6390 void 6390 void
6391 axes::properties::set_rotate3d (const octave_value& v)
6392 {
6393 rotate3d.set (v, false, false);
6394 if (rotate3d_is ("on"))
6395 {
6396 int ndim = calc_dimensions (gh_manager::get_object (get_parent ()));
6397
6398 // Disable rotate3d for 2D plots
6399 if (ndim == 2)
6400 {
6401 rotate3d.set ("off", false, false);
6402 pan.set ("on", false, false);
6403 }
6404 else
6405 pan.set ("off", false, false);
6406 }
6407 }
6408
6409 void
6391 axes::properties::set_units (const octave_value& v) 6410 axes::properties::set_units (const octave_value& v)
6392 { 6411 {
6393 if (! error_state) 6412 if (! error_state)
6394 { 6413 {
6395 caseless_str old_units = get_units (); 6414 caseless_str old_units = get_units ();
7375 default: 7394 default:
7376 break; 7395 break;
7377 } 7396 }
7378 7397
7379 xproperties.update_transform (); 7398 xproperties.update_transform ();
7399
7400 // Disable rotate3d and select pan for 2D plots
7401 xproperties.set_rotate3d (xproperties.get_rotate3d ());
7380 } 7402 }
7381 7403
7382 inline 7404 inline
7383 double force_in_range (double x, double lower, double upper) 7405 double force_in_range (double x, double lower, double upper)
7384 { 7406 {