comparison src/graphics.h.in @ 12389:5367bd36b9f8

implement autopositioning requests from text objects to axes
author Konstantinos Poulios <logari81@googlemail.com>
date Sun, 06 Feb 2011 17:17:12 +0100
parents 63dc132a1000
children 02669a1aa070
comparison
equal deleted inserted replaced
12388:cf9ca0dbc5ee 12389:5367bd36b9f8
2062 2062
2063 virtual Matrix get_boundingbox (bool /*internal*/ = false) const 2063 virtual Matrix get_boundingbox (bool /*internal*/ = false) const
2064 { return Matrix (1, 4, 0.0); } 2064 { return Matrix (1, 4, 0.0); }
2065 2065
2066 virtual void update_boundingbox (void); 2066 virtual void update_boundingbox (void);
2067
2068 virtual void update_autopos (const std::string& elem_type);
2067 2069
2068 virtual void add_listener (const caseless_str&, const octave_value&, 2070 virtual void add_listener (const caseless_str&, const octave_value&,
2069 listener_mode = POSTSET); 2071 listener_mode = POSTSET);
2070 2072
2071 virtual void delete_listener (const caseless_str&, const octave_value&, 2073 virtual void delete_listener (const caseless_str&, const octave_value&,
3092 { 3094 {
3093 update_aspectratios (); 3095 update_aspectratios ();
3094 update_camera (); 3096 update_camera ();
3095 update_axes_layout (); 3097 update_axes_layout ();
3096 } 3098 }
3099
3100 void update_autopos (const std::string& elem_type);
3101 void update_xlabel_position (void);
3102 void update_ylabel_position (void);
3103 void update_zlabel_position (void);
3104 void update_title_position (void);
3097 3105
3098 graphics_xform get_transform (void) const 3106 graphics_xform get_transform (void) const
3099 { return graphics_xform (x_render, x_render_inv, sx, sy, sz, x_zlim); } 3107 { return graphics_xform (x_render, x_render_inv, sx, sy, sz, x_zlim); }
3100 3108
3101 Matrix get_transform_matrix (void) const { return x_render; } 3109 Matrix get_transform_matrix (void) const { return x_render; }
3309 3317
3310 void update_xdir (void) { update_camera (); update_axes_layout (); } 3318 void update_xdir (void) { update_camera (); update_axes_layout (); }
3311 void update_ydir (void) { update_camera (); update_axes_layout (); } 3319 void update_ydir (void) { update_camera (); update_axes_layout (); }
3312 void update_zdir (void) { update_camera (); update_axes_layout (); } 3320 void update_zdir (void) { update_camera (); update_axes_layout (); }
3313 3321
3314 void update_xlabel_position (void);
3315 void update_ylabel_position (void);
3316 void update_zlabel_position (void);
3317 void update_title_position (void);
3318
3319 void update_ticklengths (void); 3322 void update_ticklengths (void);
3320 void update_tickdir (void) { update_ticklengths (); } 3323 void update_tickdir (void) { update_ticklengths (); }
3321 void update_tickdirmode (void) { update_ticklengths (); } 3324 void update_tickdirmode (void) { update_ticklengths (); }
3322 3325
3323 void update_xtick (void) 3326 void update_xtick (void)
3652 row_vector_property zlim hlr , Matrix () 3655 row_vector_property zlim hlr , Matrix ()
3653 bool_property xliminclude hl , "off" 3656 bool_property xliminclude hl , "off"
3654 bool_property yliminclude hl , "off" 3657 bool_property yliminclude hl , "off"
3655 bool_property zliminclude hl , "off" 3658 bool_property zliminclude hl , "off"
3656 // hidden properties for auto-positioning 3659 // hidden properties for auto-positioning
3657 radio_property positionmode h , "{auto}|manual" 3660 radio_property positionmode hu , "{auto}|manual"
3658 radio_property rotationmode h , "{auto}|manual" 3661 radio_property rotationmode hu , "{auto}|manual"
3659 radio_property horizontalalignmentmode h , "{auto}|manual" 3662 radio_property horizontalalignmentmode hu , "{auto}|manual"
3660 radio_property verticalalignmentmode h , "{auto}|manual" 3663 radio_property verticalalignmentmode hu , "{auto}|manual"
3664 radio_property autopos_tag h , "{none}|xlabel|ylabel|zlabel|title"
3661 END_PROPERTIES 3665 END_PROPERTIES
3662 3666
3663 Matrix get_data_position (void) const; 3667 Matrix get_data_position (void) const;
3664 Matrix get_extent_matrix (void) const; 3668 Matrix get_extent_matrix (void) const;
3665 const uint8NDArray& get_pixels (void) const { return pixels; } 3669 const uint8NDArray& get_pixels (void) const { return pixels; }
3701 set_zliminclude ("off"); 3705 set_zliminclude ("off");
3702 } 3706 }
3703 3707
3704 void update_text_extent (void); 3708 void update_text_extent (void);
3705 3709
3706 void update_string (void) { update_text_extent (); } 3710 void request_autopos (void);
3711 void update_positionmode (void) { request_autopos (); }
3712 void update_rotationmode (void) { request_autopos (); }
3713 void update_horizontalalignmentmode (void) { request_autopos (); }
3714 void update_verticalalignmentmode (void) { request_autopos (); }
3715
3716 void update_string (void) { update_text_extent (); request_autopos ();}
3707 void update_rotation (void) { update_text_extent (); } 3717 void update_rotation (void) { update_text_extent (); }
3708 void update_fontname (void) { update_text_extent (); } 3718 void update_fontname (void) { update_text_extent (); }
3709 void update_fontsize (void) { update_text_extent (); } 3719 void update_fontsize (void) { update_text_extent (); }
3710 void update_fontangle (void) { update_text_extent (); } 3720 void update_fontangle (void) { update_text_extent (); }
3711 void update_fontweight (void) { update_text_extent (); } 3721 void update_fontweight (void) { update_text_extent (); }