26#if ! defined (octave_gl_render_h)
27#define octave_gl_render_h 1
29#include "octave-config.h"
36 class opengl_functions;
56 virtual void draw (
const graphics_object& go,
bool toplevel =
true);
61 void draw (
const Matrix& hlist,
bool toplevel =
false);
63 virtual void set_viewport (
int w,
int h);
65 virtual Matrix get_viewport_scaled (
void)
const;
69 virtual void draw_zoom_box (
int width,
int height,
70 int x1,
int y1,
int x2,
int y2,
71 const Matrix& overlaycolor,
74 double borderalpha,
double borderwidth);
76 virtual void finish (
void);
90 bool do_rotate =
false);
93 const graphics_object& go);
95 const graphics_object& go);
96 virtual void init_gl_context (
bool enhanced,
const Matrix& backgroundColor);
99 virtual void set_clipbox (
double x1,
double x2,
double y1,
double y2,
100 double z1,
double z2);
101 virtual void set_clipping (
bool on);
102 virtual void set_font (
const base_properties& props);
103 virtual void set_color (
const Matrix& c);
106 m_interpreter = interp;
108 virtual void set_linewidth (
float w);
109 virtual void set_linestyle (
const std::string& s,
bool stipple =
false,
110 double linewidth = 0.5);
113 virtual void set_polygon_offset (
bool on,
float offset = 0.0f);
119 virtual void init_marker (
const std::string& m,
double size,
float width);
120 virtual void change_marker (
const std::string& m,
double size);
121 virtual void end_marker (
void);
122 virtual void draw_marker (
double x,
double y,
double z,
124 const double la = 1.0,
const double fa = 1.0);
126 virtual void text_to_pixels (
const std::string& txt,
129 int halign = 0,
int valign = 0,
130 double rotation = 0.0);
132 virtual void text_to_strlist (
const std::string& txt,
133 std::list<text_renderer::string>& lst,
135 int halign = 0,
int valign = 0,
136 double rotation = 0.0);
138 virtual Matrix render_text (
const std::string& txt,
139 double x,
double y,
double z,
140 int halign,
int valign,
double rotation = 0.0);
142 virtual void render_grid (
const double linewidth,
143 const std::string& gridstyle,
144 const Matrix& gridcolor,
const double gridalpha,
145 const Matrix& ticks,
double lim1,
double lim2,
146 double p1,
double p1N,
double p2,
double p2N,
147 int xyz,
bool is_3D);
149 virtual void render_tickmarks (
const Matrix& ticks,
double lim1,
double lim2,
150 double p1,
double p1N,
double p2,
double p2N,
151 double dx,
double dy,
double dz,
152 int xyz,
bool doubleside);
154 virtual void render_ticktexts (
const Matrix& ticks,
156 double lim1,
double lim2,
157 double p1,
double p2,
158 int xyz,
int ha,
int va,
159 int& wmax,
int& hmax);
161 virtual void draw_zoom_rect (
int x1,
int y1,
int x2,
int y2);
182 void init_maxlights (
void);
184 std::string get_string (
unsigned int id)
const;
196 return ((
x < m_xmin ? 1 : 0)
197 | (
x > m_xmax ? 1 : 0) << 1
198 | (y < m_ymin ? 1 : 0) << 2
199 | (y > m_ymax ? 1 : 0) << 3
200 | (z < m_zmin ? 1 : 0) << 4
201 | (z > m_zmax ? 1 : 0) << 5
206 double x,
double y,
double z,
double rotation);
208 void set_normal (
int bfl_mode,
const NDArray& n,
int j,
int i);
210 void set_ortho_coordinates (
void);
212 void restore_previous_coordinates (
void);
214 double points_to_pixels (
const double val)
const;
216 unsigned int make_marker_list (
const std::string& m,
double size,
229 void draw_all_lights (
const base_properties& props,
230 std::list<graphics_object>& obj_list);
virtual void set_interpreter(const caseless_str &interp)
bool is_nan_or_inf(double x, double y, double z) const
unsigned int m_filled_marker_id
opengl_functions & m_glfcns
unsigned int m_max_lights
virtual void set_linejoin(const std::string &)
unsigned int m_current_light
ColumnVector m_camera_dir
virtual graphics_xform get_transform(void) const
virtual ~opengl_renderer(void)=default
uint8_t clip_code(double x, double y, double z) const
text_renderer m_txt_renderer
graphics_toolkit m_toolkit
virtual void set_device_pixel_ratio(double dpr)
virtual void set_linecap(const std::string &)
virtual void set_selecting(bool on)
opengl_functions & get_opengl_functions(void) const
opengl_renderer(const opengl_renderer &)=delete
caseless_str m_interpreter
F77_RET_T const F77_DBLE * x
std::complex< double > w(std::complex< double > z, double relerr=0)
T::properties & properties(graphics_object obj)
static bool is_nan_or_inf(const octave_value &val)
void draw(QDomElement &parent_elt, pdfpainter &painter)