23 #if !defined (octave_gl_render_h)
24 #define octave_gl_render_h 1
27 #define WIN32_LEAN_AND_MEAN
33 #elif defined HAVE_OPENGL_GL_H || defined HAVE_FRAMEWORK_OPENGL
34 #include <OpenGL/gl.h>
39 #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL
40 #include <OpenGL/glu.h>
53 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (),
54 camera_pos (), camera_dir ()
64 virtual void draw (
const Matrix& hlist,
bool toplevel =
false)
68 for (
int i = len-1; i >= 0; i--)
77 virtual void set_viewport (
int w,
int h);
92 virtual void init_gl_context (
bool enhanced,
const Matrix& backgroundColor);
95 virtual void set_color (
const Matrix& c);
96 virtual void set_polygon_offset (
bool on,
double offset = 0.0);
97 virtual void set_linewidth (
float w);
98 virtual void set_linestyle (
const std::string& s,
bool stipple =
false);
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);
104 virtual void init_marker (
const std::string& m,
double size,
float width);
105 virtual void end_marker (
void);
106 virtual void draw_marker (
double x,
double y,
double z,
109 virtual void text_to_pixels (
const std::string& txt,
112 int halign = 0,
int valign = 0,
113 double rotation = 0.0);
115 virtual Matrix render_text (
const std::string& txt,
116 double x,
double y,
double z,
117 int halign,
int valign,
double rotation = 0.0);
119 virtual void draw_pixels (GLsizei
w, GLsizei h, GLenum format,
120 GLenum
type,
const GLvoid *data);
122 virtual void render_grid (
const std::string& gridstyle,
const Matrix& ticks,
123 double lim1,
double lim2,
124 double p1,
double p1N,
double p2,
double p2N,
125 int xyz,
bool is_3D);
127 virtual void render_tickmarks (
const Matrix& ticks,
double lim1,
double lim2,
128 double p1,
double p1N,
double p2,
double p2N,
129 double dx,
double dy,
double dz,
130 int xyz,
bool doubleside);
132 virtual void render_ticktexts (
const Matrix& ticks,
134 double lim1,
double lim2,
135 double p1,
double p2,
136 int xyz,
int ha,
int va,
137 int& wmax,
int& hmax);
142 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (),
143 camera_pos (), camera_dir ()
152 bool is_nan_or_inf (
double x,
double y,
double z)
const
160 return ((x <
xmin ? 1 : 0)
161 | (x >
xmax ? 1 : 0) << 1
162 | (y < ymin ? 1 : 0) << 2
163 | (y > ymax ? 1 : 0) << 3
164 | (z < zmin ? 1 : 0) << 4
165 | (z > zmax ? 1 : 0) << 5
166 | (is_nan_or_inf (x, y, z) ? 0 : 1) << 6);
169 unsigned int make_marker_list (
const std::string& m,
double size,
208 class patch_tesselator;