GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::opengl_renderer Class Reference

#include "gl-render.h"

Inheritance diagram for octave::opengl_renderer:
Collaboration diagram for octave::opengl_renderer:

Classes

class  patch_tesselator
 

Public Member Functions

 opengl_renderer (void)
 
 opengl_renderer (const opengl_renderer &)=delete
 
virtual ~opengl_renderer (void)=default
 
virtual void draw (const graphics_object &go, bool toplevel=true)
 
virtual void draw (const Matrix &hlist, bool toplevel=false)
 
virtual void finish (void)
 
virtual uint8NDArray get_pixels (int width, int height)
 
virtual graphics_xform get_transform (void) const
 
opengl_rendereroperator= (const opengl_renderer &)=delete
 
virtual void set_viewport (int w, int h)
 

Protected Member Functions

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)
 
virtual void draw_patch (const patch::properties &props)
 
virtual void draw_pixels (int w, int h, const float *data)
 
virtual void draw_pixels (int w, int h, const uint8_t *data)
 
virtual void draw_pixels (int w, int h, const uint16_t *data)
 
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 end_marker (void)
 
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)
 
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)
 

Private Member Functions

octave_uint8 clip_code (double x, double y, double z) const
 
void draw_all_lights (const base_properties &props, std::list< graphics_object > &obj_list)
 
void draw_axes_boxes (const axes::properties &props)
 
void draw_axes_children (const axes::properties &props)
 
void draw_axes_grids (const axes::properties &props)
 
void draw_axes_planes (const axes::properties &props)
 
void draw_axes_x_grid (const axes::properties &props)
 
void draw_axes_y_grid (const axes::properties &props)
 
void draw_axes_z_grid (const axes::properties &props)
 
bool is_nan_or_inf (double x, double y, double z) const
 
unsigned int make_marker_list (const std::string &m, double size, bool filled) const
 
void set_normal (int bfl_mode, const NDArray &n, int j, int i)
 

Private Attributes

ColumnVector camera_dir
 
ColumnVector camera_pos
 
unsigned int current_light
 
unsigned int filled_marker_id
 
caseless_str interpreter
 
unsigned int marker_id
 
int max_lights
 
int num_lights
 
bool selecting
 
graphics_toolkit toolkit
 
text_renderer txt_renderer
 
ColumnVector view_vector
 
graphics_xform xform
 
double xmax
 
double xmin
 
double xZ1
 
double xZ2
 
double ymax
 
double ymin
 
double zmax
 
double zmin
 

Detailed Description

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

Constructor & Destructor Documentation

◆ opengl_renderer() [1/2]

octave::opengl_renderer::opengl_renderer ( void  )

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

References err_disabled_feature(), and error().

◆ opengl_renderer() [2/2]

octave::opengl_renderer::opengl_renderer ( const opengl_renderer )
delete

◆ ~opengl_renderer()

virtual octave::opengl_renderer::~opengl_renderer ( void  )
virtualdefault

Member Function Documentation

◆ clip_code()

octave_uint8 octave::opengl_renderer::clip_code ( double  x,
double  y,
double  z 
) const
inlineprivate

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

References octave::is_nan_or_inf(), x, xmax(), xmin(), and y.

Referenced by draw_line(), and draw_text().

◆ draw() [1/2]

◆ draw() [2/2]

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

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

References gh_manager::get_object(), i, and Array< T >::numel().

◆ draw_all_lights()

◆ draw_axes()

◆ draw_axes_boxes()

◆ draw_axes_children()

◆ draw_axes_grids()

void octave::opengl_renderer::draw_axes_grids ( const axes::properties props)
private

◆ draw_axes_planes()

◆ draw_axes_x_grid()

◆ draw_axes_y_grid()

◆ draw_axes_z_grid()

◆ draw_figure()

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

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

References draw(), base_properties::get_all_children(), octave::gl_get_string(), and init_gl_context().

Referenced by draw().

◆ draw_hggroup()

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

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

References draw(), and base_properties::get_children().

Referenced by draw().

◆ draw_image()

◆ draw_light()

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

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

References current_light, i, and panic_impossible.

Referenced by draw().

◆ draw_line()

◆ draw_marker()

void octave::opengl_renderer::draw_marker ( double  x,
double  y,
double  z,
const Matrix lc,
const Matrix fc 
)
protectedvirtual

◆ draw_patch()

◆ draw_pixels() [1/3]

void octave::opengl_renderer::draw_pixels ( int  w,
int  h,
const float data 
)
protectedvirtual

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

References panic_impossible.

Referenced by draw_image().

◆ draw_pixels() [2/3]

void octave::opengl_renderer::draw_pixels ( int  w,
int  h,
const uint8_t *  data 
)
protectedvirtual

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

References panic_impossible.

◆ draw_pixels() [3/3]

void octave::opengl_renderer::draw_pixels ( int  w,
int  h,
const uint16_t *  data 
)
protectedvirtual

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

References panic_impossible.

◆ draw_surface()

◆ draw_text()

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

◆ draw_text_background()

void octave::opengl_renderer::draw_text_background ( const text::properties props,
bool  do_rotate = false 
)
protectedvirtual

◆ draw_uibuttongroup()

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

◆ draw_uipanel()

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

◆ end_marker()

void octave::opengl_renderer::end_marker ( void  )
protectedvirtual

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

References f, filled_marker_id, marker_id, panic_impossible, and set_linewidth().

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

◆ finish()

void octave::opengl_renderer::finish ( void  )
virtual

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

References panic_impossible.

Referenced by G__osmesa_print__().

◆ get_pixels()

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

◆ get_transform()

virtual graphics_xform octave::opengl_renderer::get_transform ( void  ) const
inlinevirtual

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

References xform().

Referenced by draw_text_background(), and octave::opengl_selector::fake_text().

◆ init_gl_context()

void octave::opengl_renderer::init_gl_context ( bool  enhanced,
const Matrix backgroundColor 
)
protectedvirtual

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

References c, f, panic_impossible, and warning().

Referenced by draw_figure(), draw_uibuttongroup(), and draw_uipanel().

◆ init_marker()

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

◆ is_nan_or_inf()

bool octave::opengl_renderer::is_nan_or_inf ( double  x,
double  y,
double  z 
) const
inlineprivate

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

References octave::math::isinf(), octave::math::isnan(), x, and y.

Referenced by draw_patch(), and draw_surface().

◆ make_marker_list()

unsigned int octave::opengl_renderer::make_marker_list ( const std::string m,
double  size,
bool  filled 
) const
private

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

References c, graphics_toolkit::get_screen_resolution(), i, max(), panic_impossible, sz, toolkit, and warning().

Referenced by init_marker().

◆ operator=()

opengl_renderer& octave::opengl_renderer::operator= ( const opengl_renderer )
delete

◆ render_grid()

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

◆ render_tickmarks()

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

◆ render_ticktexts()

void octave::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 octave::opengl_renderer::set_clipbox ( double  x1,
double  x2,
double  y1,
double  y2,
double  z1,
double  z2 
)
protectedvirtual

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

References p, panic_impossible, xmax, xmin, ymax, ymin, zmax, and zmin.

Referenced by draw_axes().

◆ set_clipping()

void octave::opengl_renderer::set_clipping ( bool  on)
protectedvirtual

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

References i, and panic_impossible.

Referenced by draw_all_lights(), draw_axes_children(), draw_line(), draw_text(), and init_marker().

◆ set_color()

void octave::opengl_renderer::set_color ( const Matrix c)
protectedvirtual

◆ set_font()

void octave::opengl_renderer::set_font ( const base_properties props)
protectedvirtual

◆ set_interpreter()

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

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

Referenced by draw_axes_grids().

◆ set_linecap()

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

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

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

◆ set_linejoin()

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

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

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

◆ set_linestyle()

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

◆ set_linewidth()

void octave::opengl_renderer::set_linewidth ( float  w)
protectedvirtual

◆ set_normal()

void octave::opengl_renderer::set_normal ( int  bfl_mode,
const NDArray n,
int  j,
int  i 
)
private

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

References d, i, panic_impossible, view_vector, x, and y.

Referenced by draw_surface().

◆ set_polygon_offset()

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

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

References on, and panic_impossible.

Referenced by draw_axes_planes(), draw_marker(), draw_surface(), and draw_text_background().

◆ set_selecting()

virtual void octave::opengl_renderer::set_selecting ( bool  on)
inlineprotectedvirtual

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

References on.

Referenced by octave::opengl_selector::draw().

◆ set_viewport()

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

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

References h, panic_impossible, and Faddeeva::w().

Referenced by QtHandles::GLCanvas::do_getPixels(), and QtHandles::GLCanvas::draw().

◆ setup_opengl_transformation()

◆ text_to_pixels()

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

◆ text_to_strlist()

void octave::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 4429 of file gl-render.cc.

References octave::text_renderer::text_to_strlist(), and txt_renderer.

Member Data Documentation

◆ camera_dir

ColumnVector octave::opengl_renderer::camera_dir
private

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

◆ camera_pos

ColumnVector octave::opengl_renderer::camera_pos
private

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

◆ current_light

unsigned int octave::opengl_renderer::current_light
private

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

Referenced by draw_all_lights(), draw_axes_children(), and draw_light().

◆ filled_marker_id

unsigned int octave::opengl_renderer::filled_marker_id
private

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

Referenced by draw_marker(), end_marker(), and init_marker().

◆ interpreter

caseless_str octave::opengl_renderer::interpreter
private

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

◆ marker_id

unsigned int octave::opengl_renderer::marker_id
private

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

Referenced by draw_marker(), end_marker(), and init_marker().

◆ max_lights

int octave::opengl_renderer::max_lights
private

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

Referenced by draw_all_lights(), and draw_axes_children().

◆ num_lights

int octave::opengl_renderer::num_lights
private

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

Referenced by draw_all_lights(), draw_axes_children(), draw_patch(), and draw_surface().

◆ selecting

bool octave::opengl_renderer::selecting
private

◆ toolkit

graphics_toolkit octave::opengl_renderer::toolkit
private

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

Referenced by draw(), and make_marker_list().

◆ txt_renderer

text_renderer octave::opengl_renderer::txt_renderer
private

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

Referenced by render_text(), set_color(), set_font(), text_to_pixels(), and text_to_strlist().

◆ view_vector

ColumnVector octave::opengl_renderer::view_vector
private

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

Referenced by draw_axes_children(), draw_patch(), and set_normal().

◆ xform

◆ xmax

double octave::opengl_renderer::xmax
private

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

Referenced by draw_image(), and set_clipbox().

◆ xmin

double octave::opengl_renderer::xmin
private

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

Referenced by draw_image(), and set_clipbox().

◆ xZ1

double octave::opengl_renderer::xZ1
private

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

Referenced by draw_text_background(), init_marker(), and setup_opengl_transformation().

◆ xZ2

double octave::opengl_renderer::xZ2
private

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

Referenced by draw_text_background(), init_marker(), and setup_opengl_transformation().

◆ ymax

double octave::opengl_renderer::ymax
private

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

Referenced by draw_image(), and set_clipbox().

◆ ymin

double octave::opengl_renderer::ymin
private

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

Referenced by draw_image(), and set_clipbox().

◆ zmax

double octave::opengl_renderer::zmax
private

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

Referenced by draw_line(), and set_clipbox().

◆ zmin

double octave::opengl_renderer::zmin
private

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

Referenced by draw_line(), and set_clipbox().


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