Mercurial > hg > octave-nkf
changeset 12361:a950bfb7b8e8 release-3-4-x
gl-renderer.cc and gl2ps-renderer.cc: access objects directly from gh_manager instead of working with handles
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 01 Feb 2011 16:25:15 -0500 |
parents | 523c5bcc1a76 |
children | 3de1dae1e403 |
files | src/ChangeLog src/DLD-FUNCTIONS/__init_fltk__.cc src/gl-render.h src/gl2ps-renderer.h src/graphics.h.in |
diffstat | 5 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2011-02-01 John W. Eaton <jwe@octave.org> + + * gl-render.h (opengl_renderer::draw (const Matrix& hlist)): + Use get_object instead of lookup. + * DLD-FUNCTIONS/__init_fltk__.cc (Fl_Gl_Window::draw): Likewise. + * graphics.h.in (gh_manager::get_object (double)): New function. + * gl-renderer.h (opengl_renderer::draw (const graphics_handle&)): + Delete. + * gl2ps-renderer.h (glps_renderer::draw (const graphics_handle&)): + Delete. + 2011-02-01 John W. Eaton <jwe@octave.org> * gl2ps-renderer.h: Remove virtual tag for derived virtual functions.
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -157,13 +157,13 @@ { glps_renderer rend (print_fid, print_term); - rend.draw (gh_manager::lookup (number)); + rend.draw (gh_manager::get_object (number)); print_fid = -1; } else { - renderer.draw (gh_manager::lookup (number)); + renderer.draw (gh_manager::get_object (number)); if (zoom ()) overlay ();
--- a/src/gl-render.h +++ b/src/gl-render.h @@ -59,9 +59,6 @@ virtual ~opengl_renderer (void) { } - virtual void draw (const graphics_handle& h) - { draw (gh_manager::get_object (h)); } - virtual void draw (const graphics_object& go); virtual void draw (const Matrix& hlist) @@ -70,10 +67,10 @@ for (int i = len-1; i >= 0; i--) { - graphics_handle h = gh_manager::lookup (hlist(i)); + graphics_object obj = gh_manager::get_object (hlist(i)); - if (h.ok ()) - draw (h); + if (obj) + draw (obj); } }
--- a/src/gl2ps-renderer.h +++ b/src/gl2ps-renderer.h @@ -37,11 +37,6 @@ ~glps_renderer (void) { } - void draw (const graphics_handle& h) - { - draw (gh_manager::get_object (h)); - } - void draw (const graphics_object& go); protected:
--- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -4313,6 +4313,11 @@ ? lookup (val.double_value ()) : graphics_handle (); } + static graphics_object get_object (double val) + { + return get_object (lookup (val)); + } + static graphics_object get_object (const graphics_handle& h) { return instance_ok () ? instance->do_get_object (h) : graphics_object ();