GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
opengl_renderer Class Reference

#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_functionsget_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_functionsm_glfcns
 
graphics_xform m_xform
 
double m_xmax
 
double m_xmin
 
double m_ymax
 
double m_ymin
 
double m_zmax
 
double m_zmin
 

Detailed Description

Definition at line 38 of file gl-render.h.

Constructor & Destructor Documentation

◆ opengl_renderer()

opengl_renderer::opengl_renderer ( opengl_functions glfcns)

Definition at line 689 of file gl-render.cc.

References err_disabled_feature(), and error().

◆ ~opengl_renderer()

virtual opengl_renderer::~opengl_renderer ( )
virtualdefault

Member Function Documentation

◆ change_marker()

void opengl_renderer::change_marker ( const std::string &  m,
double  size 
)
protectedvirtual

Definition at line 4504 of file gl-render.cc.

Referenced by draw_scatter().

◆ draw() [1/2]

void opengl_renderer::draw ( const graphics_object &  go,
bool  toplevel = true 
)
virtual

◆ draw() [2/2]

void opengl_renderer::draw ( const Matrix hlist,
bool  toplevel = false 
)

◆ draw_axes()

void opengl_renderer::draw_axes ( const axes::properties &  props)
protectedvirtual

◆ draw_figure()

void opengl_renderer::draw_figure ( const figure::properties &  props)
protectedvirtual

Definition at line 782 of file gl-render.cc.

References draw(), and init_gl_context().

Referenced by draw().

◆ draw_hggroup()

void opengl_renderer::draw_hggroup ( const hggroup::properties &  props)
protectedvirtual

Definition at line 3901 of file gl-render.cc.

References draw().

Referenced by draw().

◆ draw_image()

void opengl_renderer::draw_image ( const image::properties &  props)
protectedvirtual

Definition at line 4077 of file gl-render.cc.

References x.

Referenced by draw().

◆ draw_light()

void opengl_renderer::draw_light ( const light::properties &  props)
protectedvirtual

Definition at line 3864 of file gl-render.cc.

References opengl_functions::glEnable(), opengl_functions::glLightfv(), and m_glfcns.

Referenced by draw().

◆ draw_line()

◆ draw_marker()

◆ draw_patch()

◆ draw_scatter()

void opengl_renderer::draw_scatter ( const scatter::properties &  props)
protectedvirtual

◆ draw_surface()

◆ draw_text()

void opengl_renderer::draw_text ( const text::properties &  props)
protectedvirtual

◆ draw_text_background()

◆ draw_uibuttongroup()

void opengl_renderer::draw_uibuttongroup ( const uibuttongroup::properties &  props,
const graphics_object &  go 
)
protectedvirtual

Definition at line 822 of file gl-render.cc.

References draw(), and init_gl_context().

Referenced by draw().

◆ draw_uipanel()

void opengl_renderer::draw_uipanel ( const uipanel::properties &  props,
const graphics_object &  go 
)
protectedvirtual

Definition at line 804 of file gl-render.cc.

References draw(), and init_gl_context().

Referenced by draw().

◆ draw_zoom_box()

◆ draw_zoom_rect()

void opengl_renderer::draw_zoom_rect ( int  x1,
int  y1,
int  x2,
int  y2 
)
protectedvirtual

Definition at line 1138 of file gl-render.cc.

References opengl_functions::glVertex2d(), and m_glfcns.

Referenced by draw_zoom_box().

◆ end_marker()

void opengl_renderer::end_marker ( )
protectedvirtual

◆ finish()

void opengl_renderer::finish ( )
virtual

Definition at line 1266 of file gl-render.cc.

References opengl_functions::glFinish(), and m_glfcns.

◆ get_opengl_functions()

opengl_functions & opengl_renderer::get_opengl_functions ( ) const
inline

Definition at line 48 of file gl-render.h.

◆ get_pixels()

uint8NDArray opengl_renderer::get_pixels ( int  width,
int  height 
)
virtual

◆ get_transform()

virtual graphics_xform opengl_renderer::get_transform ( ) const
inlinevirtual

Definition at line 60 of file gl-render.h.

Referenced by draw_text_background().

◆ get_viewport_scaled()

Matrix opengl_renderer::get_viewport_scaled ( ) const
virtual

◆ init_gl_context()

◆ init_marker()

void opengl_renderer::init_marker ( const std::string &  m,
double  size,
float  width 
)
protectedvirtual

◆ render_grid()

void opengl_renderer::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 
)
protectedvirtual

◆ render_text()

Matrix opengl_renderer::render_text ( const std::string &  txt,
double  x,
double  y,
double  z,
int  halign,
int  valign,
double  rotation = 0.0 
)
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().

◆ render_tickmarks()

void opengl_renderer::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 
)
protectedvirtual

◆ render_ticktexts()

void opengl_renderer::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 
)
protectedvirtual

◆ set_clipbox()

void opengl_renderer::set_clipbox ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2 
)
protectedvirtual

◆ set_clipping()

void opengl_renderer::set_clipping ( bool  on)
protectedvirtual

◆ set_color()

void opengl_renderer::set_color ( const Matrix c)
protectedvirtual

◆ set_device_pixel_ratio()

virtual void opengl_renderer::set_device_pixel_ratio ( double  dpr)
inlinevirtual

Definition at line 58 of file gl-render.h.

◆ set_font()

void opengl_renderer::set_font ( const base_properties &  props)
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().

◆ set_interpreter()

virtual void opengl_renderer::set_interpreter ( const caseless_str interp)
inlineprotectedvirtual

Definition at line 98 of file gl-render.h.

◆ set_linecap()

virtual void opengl_renderer::set_linecap ( const std::string &  )
inlineprotectedvirtual

Definition at line 105 of file gl-render.h.

Referenced by draw_line(), draw_patch(), and draw_surface().

◆ set_linejoin()

virtual void opengl_renderer::set_linejoin ( const std::string &  )
inlineprotectedvirtual

Definition at line 106 of file gl-render.h.

Referenced by draw_line(), draw_patch(), and draw_surface().

◆ set_linestyle()

void opengl_renderer::set_linestyle ( const std::string &  s,
bool  stipple = false,
double  linewidth = 0.5 
)
protectedvirtual

◆ set_linewidth()

void opengl_renderer::set_linewidth ( float  w)
protectedvirtual

◆ set_polygon_offset()

void opengl_renderer::set_polygon_offset ( bool  on,
float  offset = 0.0f 
)
protectedvirtual

◆ set_selecting()

virtual void opengl_renderer::set_selecting ( bool  on)
inlineprotectedvirtual

Definition at line 108 of file gl-render.h.

◆ set_viewport()

void opengl_renderer::set_viewport ( int  w,
int  h 
)
virtual

Definition at line 4199 of file gl-render.cc.

References opengl_functions::glViewport(), and m_glfcns.

◆ setup_opengl_transformation()

void opengl_renderer::setup_opengl_transformation ( const axes::properties &  props)
protectedvirtual

◆ text_to_pixels()

void opengl_renderer::text_to_pixels ( const std::string &  txt,
uint8NDArray pixels,
Matrix bbox,
int  halign = 0,
int  valign = 0,
double  rotation = 0.0 
)
protectedvirtual

Definition at line 4900 of file gl-render.cc.

References text_renderer::text_to_pixels().

Referenced by render_text().

◆ text_to_strlist()

void opengl_renderer::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 
)
protectedvirtual

Definition at line 4910 of file gl-render.cc.

References text_renderer::text_to_strlist().

Member Data Documentation

◆ m_devpixratio

double opengl_renderer::m_devpixratio
protected

◆ m_glfcns

◆ m_xform

graphics_xform opengl_renderer::m_xform
protected

◆ m_xmax

double opengl_renderer::m_xmax
protected

Definition at line 163 of file gl-render.h.

Referenced by set_clipbox().

◆ m_xmin

double opengl_renderer::m_xmin
protected

Definition at line 163 of file gl-render.h.

Referenced by set_clipbox().

◆ m_ymax

double opengl_renderer::m_ymax
protected

Definition at line 164 of file gl-render.h.

Referenced by set_clipbox().

◆ m_ymin

double opengl_renderer::m_ymin
protected

Definition at line 164 of file gl-render.h.

Referenced by set_clipbox().

◆ m_zmax

double opengl_renderer::m_zmax
protected

Definition at line 165 of file gl-render.h.

Referenced by draw_line(), and set_clipbox().

◆ m_zmin

double opengl_renderer::m_zmin
protected

Definition at line 165 of file gl-render.h.

Referenced by draw_line(), and set_clipbox().


The documentation for this class was generated from the following files: