#include "gl-render.h"
Public Member Functions | |
opengl_renderer (opengl_functions &glfcns) | |
virtual | ~opengl_renderer ()=default |
virtual void | draw (const graphics_object &go, bool toplevel=true) |
void | draw (const Matrix &hlist, bool toplevel=false) |
virtual void | draw_zoom_box (int width, int height, int x1, int y1, int x2, int y2, const Matrix &overlaycolor, double overlayalpha, const Matrix &bordercolor, double borderalpha, double borderwidth) |
virtual void | finish () |
opengl_functions & | get_opengl_functions () const |
virtual uint8NDArray | get_pixels (int width, int height) |
virtual graphics_xform | get_transform () const |
virtual Matrix | get_viewport_scaled () const |
virtual void | set_device_pixel_ratio (double dpr) |
virtual void | set_viewport (int w, int h) |
Protected Member Functions | |
virtual void | change_marker (const std::string &m, double size) |
virtual void | draw_axes (const axes::properties &props) |
virtual void | draw_figure (const figure::properties &props) |
virtual void | draw_hggroup (const hggroup::properties &props) |
virtual void | draw_image (const image::properties &props) |
virtual void | draw_light (const light::properties &props) |
virtual void | draw_line (const line::properties &props) |
virtual void | draw_marker (double x, double y, double z, const Matrix &lc, const Matrix &fc, const double la=1.0, const double fa=1.0) |
virtual void | draw_patch (const patch::properties &props) |
virtual void | draw_scatter (const scatter::properties &props) |
virtual void | draw_surface (const surface::properties &props) |
virtual void | draw_text (const text::properties &props) |
virtual void | draw_text_background (const text::properties &props, bool do_rotate=false) |
virtual void | draw_uibuttongroup (const uibuttongroup::properties &props, const graphics_object &go) |
virtual void | draw_uipanel (const uipanel::properties &props, const graphics_object &go) |
virtual void | draw_zoom_rect (int x1, int y1, int x2, int y2) |
virtual void | end_marker () |
virtual void | init_gl_context (bool enhanced, const Matrix &backgroundColor) |
virtual void | init_marker (const std::string &m, double size, float width) |
virtual void | render_grid (const double linewidth, const std::string &gridstyle, const Matrix &gridcolor, const double gridalpha, const Matrix &ticks, double lim1, double lim2, double p1, double p1N, double p2, double p2N, int xyz, bool is_3D) |
virtual Matrix | render_text (const std::string &txt, double x, double y, double z, int halign, int valign, double rotation=0.0) |
virtual void | render_tickmarks (const Matrix &ticks, double lim1, double lim2, double p1, double p1N, double p2, double p2N, double dx, double dy, double dz, int xyz, bool doubleside, bool tickdir_both) |
virtual void | render_ticktexts (const Matrix &ticks, const string_vector &ticklabels, double lim1, double lim2, double p1, double p2, int xyz, int ha, int va, int &wmax, int &hmax) |
virtual void | set_clipbox (double x1, double x2, double y1, double y2, double z1, double z2) |
virtual void | set_clipping (bool on) |
virtual void | set_color (const Matrix &c) |
virtual void | set_font (const base_properties &props) |
virtual void | set_interpreter (const caseless_str &interp) |
virtual void | set_linecap (const std::string &) |
virtual void | set_linejoin (const std::string &) |
virtual void | set_linestyle (const std::string &s, bool stipple=false, double linewidth=0.5) |
virtual void | set_linewidth (float w) |
virtual void | set_polygon_offset (bool on, float offset=0.0f) |
virtual void | set_selecting (bool on) |
virtual void | setup_opengl_transformation (const axes::properties &props) |
virtual void | text_to_pixels (const std::string &txt, uint8NDArray &pixels, Matrix &bbox, int halign=0, int valign=0, double rotation=0.0) |
virtual void | text_to_strlist (const std::string &txt, std::list< text_renderer::string > &lst, Matrix &bbox, int halign=0, int valign=0, double rotation=0.0) |
Protected Attributes | |
double | m_devpixratio |
opengl_functions & | m_glfcns |
graphics_xform | m_xform |
double | m_xmax |
double | m_xmin |
double | m_ymax |
double | m_ymin |
double | m_zmax |
double | m_zmin |
Definition at line 38 of file gl-render.h.
opengl_renderer::opengl_renderer | ( | opengl_functions & | glfcns | ) |
Definition at line 689 of file gl-render.cc.
References err_disabled_feature(), and error().
|
virtualdefault |
|
protectedvirtual |
Definition at line 4504 of file gl-render.cc.
Referenced by draw_scatter().
|
virtual |
Definition at line 719 of file gl-render.cc.
References draw_axes(), draw_figure(), draw_hggroup(), draw_image(), draw_light(), draw_line(), draw_patch(), draw_scatter(), draw_surface(), draw_text(), draw_uibuttongroup(), draw_uipanel(), opengl_functions::glGetError(), m_glfcns, and warning().
Referenced by draw(), draw_figure(), draw_hggroup(), draw_uibuttongroup(), and draw_uipanel().
Definition at line 4183 of file gl-render.cc.
References __get_gh_manager__(), draw(), gh_manager::get_object(), len, and Array< T, Alloc >::numel().
|
protectedvirtual |
Definition at line 2325 of file gl-render.cc.
References opengl_functions::glDisable(), opengl_functions::glEnable(), m_glfcns, set_clipbox(), setup_opengl_transformation(), and warning().
Referenced by draw().
|
protectedvirtual |
Definition at line 782 of file gl-render.cc.
References draw(), and init_gl_context().
Referenced by draw().
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Definition at line 3864 of file gl-render.cc.
References opengl_functions::glEnable(), opengl_functions::glLightfv(), and m_glfcns.
Referenced by draw().
|
protectedvirtual |
Definition at line 2397 of file gl-render.cc.
References draw_marker(), end_marker(), opengl_functions::glBegin(), opengl_functions::glEnd(), opengl_functions::glVertex2d(), opengl_functions::glVertex3d(), init_marker(), m_glfcns, m_xform, m_zmax, m_zmin, Array< T, Alloc >::numel(), set_clipping(), set_color(), set_linecap(), set_linejoin(), set_linestyle(), set_linewidth(), and x.
Referenced by draw().
|
protectedvirtual |
Definition at line 4549 of file gl-render.cc.
References opengl_functions::glCallList(), opengl_functions::glColor4d(), opengl_functions::glEdgeFlag(), opengl_functions::glLoadIdentity(), opengl_functions::glPolygonMode(), opengl_functions::glTranslated(), m_glfcns, m_xform, Array< T, Alloc >::numel(), set_polygon_offset(), and x.
Referenced by draw_line(), draw_patch(), draw_scatter(), and draw_surface().
|
protectedvirtual |
Definition at line 3210 of file gl-render.cc.
References Array< T, Alloc >::columns(), Array< T, Alloc >::data(), draw_marker(), end_marker(), f, FLAT, opengl_functions::glBegin(), opengl_functions::glColor3dv(), opengl_functions::glColor4d(), opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glEnd(), opengl_functions::glMaterialf(), opengl_functions::glMaterialfv(), opengl_functions::glShadeModel(), opengl_functions::glVertex3d(), GOURAUD, init_marker(), INTERP, Array< T, Alloc >::isempty(), LIGHT_MODE, m_glfcns, m_xform, Array< T, Alloc >::numel(), Matrix::resize(), Array< T, Alloc >::rows(), set_linecap(), set_linejoin(), set_linestyle(), set_linewidth(), UNIFORM, and warning().
Referenced by draw().
|
protectedvirtual |
Definition at line 3755 of file gl-render.cc.
References __get_gh_manager__(), change_marker(), draw_marker(), end_marker(), gh_manager::get_object(), init_marker(), Array< T, Alloc >::isempty(), Array< T, Alloc >::numel(), Matrix::resize(), Array< T, Alloc >::rows(), warning(), and x.
Referenced by draw().
|
protectedvirtual |
Definition at line 2543 of file gl-render.cc.
References Array< T, Alloc >::columns(), Array< T, Alloc >::data(), Array< T, Alloc >::dims(), draw_marker(), end_marker(), FLAT, opengl_functions::glBegin(), opengl_functions::glColor3dv(), opengl_functions::glColor3fv(), opengl_functions::glColor4d(), opengl_functions::glColor4fv(), opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glEnd(), opengl_functions::glMaterialf(), opengl_functions::glMaterialfv(), opengl_functions::glShadeModel(), opengl_functions::glVertex3d(), GOURAUD, init_marker(), INTERP, Array< T, Alloc >::isempty(), LIGHT_MODE, m_glfcns, m_xform, Array< T, Alloc >::rows(), set_linecap(), set_linejoin(), set_linestyle(), set_linewidth(), set_polygon_offset(), TEXTURE, UNIFORM, and x.
Referenced by draw().
|
protectedvirtual |
Definition at line 3953 of file gl-render.cc.
References draw_text_background(), m_xform, Array< T, Alloc >::numel(), render_text(), set_clipping(), and set_font().
Referenced by draw().
|
protectedvirtual |
Definition at line 3991 of file gl-render.cc.
References get_transform(), opengl_functions::glBegin(), opengl_functions::glColor3f(), opengl_functions::glEnd(), opengl_functions::glIsEnabled(), opengl_functions::glRotated(), opengl_functions::glTranslated(), opengl_functions::glVertex2d(), Array< T, Alloc >::isempty(), m_devpixratio, m_glfcns, set_linestyle(), set_linewidth(), and set_polygon_offset().
Referenced by draw_text().
|
protectedvirtual |
Definition at line 822 of file gl-render.cc.
References draw(), and init_gl_context().
Referenced by draw().
|
protectedvirtual |
Definition at line 804 of file gl-render.cc.
References draw(), and init_gl_context().
Referenced by draw().
|
virtual |
Definition at line 1164 of file gl-render.cc.
References draw_zoom_rect(), opengl_functions::glBegin(), opengl_functions::glColor4f(), opengl_functions::glDisable(), opengl_functions::glEnd(), opengl_functions::glLineWidth(), opengl_functions::glLoadIdentity(), opengl_functions::glMatrixMode(), opengl_functions::glOrtho(), opengl_functions::glPopAttrib(), opengl_functions::glPopMatrix(), opengl_functions::glPushAttrib(), opengl_functions::glPushMatrix(), and m_glfcns.
Definition at line 1138 of file gl-render.cc.
References opengl_functions::glVertex2d(), and m_glfcns.
Referenced by draw_zoom_box().
|
protectedvirtual |
Definition at line 4525 of file gl-render.cc.
References opengl_functions::glDeleteLists(), opengl_functions::glMatrixMode(), opengl_functions::glPopMatrix(), m_glfcns, and set_linewidth().
Referenced by draw_line(), draw_patch(), draw_scatter(), and draw_surface().
|
virtual |
Definition at line 1266 of file gl-render.cc.
References opengl_functions::glFinish(), and m_glfcns.
|
inline |
Definition at line 48 of file gl-render.h.
|
virtual |
Definition at line 1229 of file gl-render.cc.
References opengl_functions::glPixelStorei(), opengl_functions::glReadPixels(), m_glfcns, MArray< T >::permute(), and Array< T, Alloc >::rwdata().
|
inlinevirtual |
Definition at line 60 of file gl-render.h.
Referenced by draw_text_background().
|
virtual |
Definition at line 4219 of file gl-render.cc.
References opengl_functions::glGetIntegerv(), m_devpixratio, and m_glfcns.
Referenced by init_marker(), and setup_opengl_transformation().
|
protectedvirtual |
Definition at line 840 of file gl-render.cc.
References opengl_functions::glAlphaFunc(), opengl_functions::glBlendFunc(), opengl_functions::glClear(), opengl_functions::glClearColor(), opengl_functions::glDepthFunc(), opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glGetError(), opengl_functions::glGetIntegerv(), opengl_functions::glHint(), m_glfcns, Array< T, Alloc >::numel(), and warning().
Referenced by draw_figure(), draw_uibuttongroup(), and draw_uipanel().
|
protectedvirtual |
Definition at line 4471 of file gl-render.cc.
References get_viewport_scaled(), opengl_functions::glLoadIdentity(), opengl_functions::glMatrixMode(), opengl_functions::glOrtho(), opengl_functions::glPushMatrix(), m_glfcns, set_clipping(), and set_linewidth().
Referenced by draw_line(), draw_patch(), draw_scatter(), and draw_surface().
|
protectedvirtual |
Definition at line 910 of file gl-render.cc.
References opengl_functions::glBegin(), opengl_functions::glColor3dv(), opengl_functions::glColor4d(), opengl_functions::glEnd(), opengl_functions::glVertex3d(), m_glfcns, Array< T, Alloc >::numel(), set_linestyle(), X_AXIS, Y_AXIS, and Z_AXIS.
|
protectedvirtual |
Definition at line 4920 of file gl-render.cc.
References text_renderer::ok(), render_text(), text_to_pixels(), and x.
Referenced by draw_text(), render_text(), and render_ticktexts().
|
protectedvirtual |
Definition at line 986 of file gl-render.cc.
References opengl_functions::glBegin(), opengl_functions::glEnd(), opengl_functions::glVertex3d(), m_glfcns, Array< T, Alloc >::numel(), X_AXIS, Y_AXIS, and Z_AXIS.
|
protectedvirtual |
Definition at line 1068 of file gl-render.cc.
References Array< T, Alloc >::numel(), string_vector::numel(), render_text(), X_AXIS, Y_AXIS, and Z_AXIS.
|
protectedvirtual |
Definition at line 4392 of file gl-render.cc.
References Array< T, Alloc >::data(), opengl_functions::glClipPlane(), m_glfcns, m_xmax, m_xmin, m_ymax, m_ymin, m_zmax, and m_zmin.
Referenced by draw_axes().
|
protectedvirtual |
Definition at line 4442 of file gl-render.cc.
References opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glIsEnabled(), and m_glfcns.
Referenced by draw_line(), draw_text(), and init_marker().
|
protectedvirtual |
Definition at line 4248 of file gl-render.cc.
References Array< T, Alloc >::data(), opengl_functions::glColor3dv(), Array< T, Alloc >::isempty(), m_glfcns, and text_renderer::set_color().
Referenced by draw_line().
|
inlinevirtual |
Definition at line 58 of file gl-render.h.
|
protectedvirtual |
Definition at line 4270 of file gl-render.cc.
References m_devpixratio, text_renderer::set_anti_aliasing(), and text_renderer::set_font().
Referenced by draw_text().
|
inlineprotectedvirtual |
Definition at line 98 of file gl-render.h.
|
inlineprotectedvirtual |
Definition at line 105 of file gl-render.h.
Referenced by draw_line(), draw_patch(), and draw_surface().
|
inlineprotectedvirtual |
Definition at line 106 of file gl-render.h.
Referenced by draw_line(), draw_patch(), and draw_surface().
|
protectedvirtual |
Definition at line 4331 of file gl-render.cc.
References opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glLineStipple(), m_devpixratio, and m_glfcns.
Referenced by draw_line(), draw_patch(), draw_surface(), draw_text_background(), and render_grid().
|
protectedvirtual |
Definition at line 4312 of file gl-render.cc.
References opengl_functions::glLineWidth(), m_devpixratio, and m_glfcns.
Referenced by draw_line(), draw_patch(), draw_surface(), draw_text_background(), end_marker(), and init_marker().
Definition at line 4282 of file gl-render.cc.
References opengl_functions::glDisable(), opengl_functions::glEnable(), opengl_functions::glPolygonOffset(), and m_glfcns.
Referenced by draw_marker(), draw_surface(), and draw_text_background().
|
inlineprotectedvirtual |
Definition at line 108 of file gl-render.h.
Definition at line 4199 of file gl-render.cc.
References opengl_functions::glViewport(), and m_glfcns.
|
protectedvirtual |
Definition at line 1283 of file gl-render.cc.
References Array< T, Alloc >::data(), get_viewport_scaled(), opengl_functions::glClear(), opengl_functions::glLoadIdentity(), opengl_functions::glMatrixMode(), opengl_functions::glMultMatrixd(), opengl_functions::glOrtho(), opengl_functions::glScaled(), m_glfcns, and m_xform.
Referenced by draw_axes().
|
protectedvirtual |
Definition at line 4900 of file gl-render.cc.
References text_renderer::text_to_pixels().
Referenced by render_text().
|
protectedvirtual |
Definition at line 4910 of file gl-render.cc.
References text_renderer::text_to_strlist().
|
protected |
Definition at line 168 of file gl-render.h.
Referenced by draw_text_background(), get_viewport_scaled(), set_font(), set_linestyle(), and set_linewidth().
|
protected |
Definition at line 160 of file gl-render.h.
Referenced by draw(), draw_axes(), draw_light(), draw_line(), draw_marker(), draw_patch(), draw_surface(), draw_text_background(), draw_zoom_box(), draw_zoom_rect(), end_marker(), finish(), get_pixels(), get_viewport_scaled(), init_gl_context(), init_marker(), render_grid(), render_tickmarks(), set_clipbox(), set_clipping(), set_color(), set_linestyle(), set_linewidth(), set_polygon_offset(), set_viewport(), and setup_opengl_transformation().
|
protected |
Definition at line 171 of file gl-render.h.
Referenced by draw_line(), draw_marker(), draw_patch(), draw_surface(), draw_text(), and setup_opengl_transformation().
|
protected |
Definition at line 163 of file gl-render.h.
Referenced by set_clipbox().
|
protected |
Definition at line 163 of file gl-render.h.
Referenced by set_clipbox().
|
protected |
Definition at line 164 of file gl-render.h.
Referenced by set_clipbox().
|
protected |
Definition at line 164 of file gl-render.h.
Referenced by set_clipbox().
|
protected |
Definition at line 165 of file gl-render.h.
Referenced by draw_line(), and set_clipbox().
|
protected |
Definition at line 165 of file gl-render.h.
Referenced by draw_line(), and set_clipbox().