Mercurial > octave
annotate libinterp/corefcn/gl-render.h @ 20232:a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
* liboctave/array/Array.h (Array::length): deprecate for ::numel.
* liboctave/array/Sparse.h (Sparse::length): deprecate for ::numel.
* libgui/graphics/QtHandlesUtils.cc, libgui/src/octave-qt-link.cc,
libinterp/corefcn/Cell.cc, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/cellfun.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl-render.h, libinterp/corefcn/graphics.cc,
libinterp/corefcn/graphics.in.h, libinterp/corefcn/help.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc,
libinterp/corefcn/ls-oct-ascii.h, libinterp/corefcn/lsode.cc,
libinterp/corefcn/matrix_type.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-map.cc, libinterp/corefcn/oct-map.h,
libinterp/corefcn/oct-obj.h, libinterp/corefcn/oct-stream.cc,
libinterp/corefcn/oct-stream.h, libinterp/corefcn/pr-output.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/rand.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/strfns.cc,
libinterp/corefcn/sub2ind.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/tsearch.cc,
libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc,
libinterp/corefcn/variables.cc, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xpow.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__magick_read__.cc,
libinterp/dldfcn/audiodevinfo.cc, libinterp/dldfcn/ccolamd.cc,
libinterp/dldfcn/colamd.cc, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h,
libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-java.cc,
libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov.cc,
libinterp/operators/op-int.h, libinterp/parse-tree/pt-pr-code.cc,
liboctave/array/Array-util.cc, liboctave/array/Array.cc,
liboctave/array/CColVector.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CRowVector.cc,
liboctave/array/DiagArray2.cc, liboctave/array/DiagArray2.h,
liboctave/array/MArray.cc, liboctave/array/PermMatrix.cc,
liboctave/array/PermMatrix.h, liboctave/array/Sparse.cc,
liboctave/array/boolMatrix.cc, liboctave/array/chMatrix.cc,
liboctave/array/chNDArray.cc, liboctave/array/dColVector.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dRowVector.cc, liboctave/array/fCColVector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fCRowVector.cc, liboctave/array/fColVector.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/fRowVector.cc, liboctave/array/idx-vector.cc,
liboctave/array/intNDArray.cc, liboctave/numeric/CmplxCHOL.cc,
liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc,
liboctave/numeric/DASPK.cc, liboctave/numeric/DASRT.cc,
liboctave/numeric/DASSL.cc, liboctave/numeric/LSODE.cc,
liboctave/numeric/ODES.cc, liboctave/numeric/ODES.h,
liboctave/numeric/base-dae.h, liboctave/numeric/base-lu.cc,
liboctave/numeric/dbleCHOL.cc, liboctave/numeric/dbleLU.cc,
liboctave/numeric/dbleQR.cc, liboctave/numeric/eigs-base.cc,
liboctave/numeric/fCmplxCHOL.cc, liboctave/numeric/fCmplxLU.cc,
liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatCHOL.cc,
liboctave/numeric/floatLU.cc, liboctave/numeric/floatQR.cc,
liboctave/numeric/lo-specfun.cc, liboctave/numeric/oct-rand.cc,
liboctave/numeric/oct-spparms.cc, liboctave/numeric/sparse-base-chol.cc,
liboctave/operators/mx-inlines.cc, liboctave/system/file-ops.cc,
liboctave/util/glob-match.h, liboctave/util/kpse.cc,
liboctave/util/lo-regexp.cc, liboctave/util/oct-glob.cc,
liboctave/util/pathsearch.cc, liboctave/util/str-vec.cc,
liboctave/util/str-vec.h, liboctave/util/url-transfer.cc: replace all usage
of Array::length() and Sparse::length() with ::numel().
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Sat, 30 May 2015 03:14:07 +0100 |
parents | 06979876af7d |
children | 6db2ea5556a4 |
rev | line source |
---|---|
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
1 /* |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
2 |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
18868
diff
changeset
|
3 Copyright (C) 2008-2015 Michael Goffioul |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
4 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
5 This file is part of Octave. |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
6 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
10 option) any later version. |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
11 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
15 for more details. |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
16 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
20 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
21 */ |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
22 |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
23 #if !defined (octave_gl_render_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
24 #define octave_gl_render_h 1 |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
25 |
7845
25f5d628bc8a
Fix OpenGL/FLTK compilation under Windows.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7834
diff
changeset
|
26 #ifdef HAVE_WINDOWS_H |
10346
65d5776379c3
Reduce the amount of stuff included by windows.h and avoid min/max being #define-d
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10313
diff
changeset
|
27 #define WIN32_LEAN_AND_MEAN |
7845
25f5d628bc8a
Fix OpenGL/FLTK compilation under Windows.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7834
diff
changeset
|
28 #include <windows.h> |
25f5d628bc8a
Fix OpenGL/FLTK compilation under Windows.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7834
diff
changeset
|
29 #endif |
25f5d628bc8a
Fix OpenGL/FLTK compilation under Windows.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7834
diff
changeset
|
30 |
7945 | 31 #ifdef HAVE_GL_GL_H |
7834
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7833
diff
changeset
|
32 #include <GL/gl.h> |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8022
diff
changeset
|
33 #elif defined HAVE_OPENGL_GL_H || defined HAVE_FRAMEWORK_OPENGL |
7945 | 34 #include <OpenGL/gl.h> |
35 #endif | |
36 | |
37 #ifdef HAVE_GL_GLU_H | |
7834
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7833
diff
changeset
|
38 #include <GL/glu.h> |
8724
a50228129dba
Introduce new macro OCTAVE_GLUTESSCALLBACK_THREEDOTS. Use definitions HAVE_FRAMEWORK_OPENGL and HAVE_GLUTESSCALLBACK_THREEDOTS for Mac's framework OpenGL implementation.
Ben Abbott <bpabbott@mac.com>
parents:
8022
diff
changeset
|
39 #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL |
7945 | 40 #include <OpenGL/glu.h> |
41 #endif | |
7834
caab78e7e377
added checks for fltk & freetype in configure script
Shai Ayal <shaiay@sourceforge.net>
parents:
7833
diff
changeset
|
42 |
18866 | 43 #ifdef HAVE_GL_GLEXT_H |
44 #include <GL/glext.h> | |
45 #elif defined HAVE_OPENGL_GLEXT_H || defined HAVE_FRAMEWORK_OPENGL | |
46 #include <OpenGL/glext.h> | |
47 #endif | |
48 | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
49 #include "graphics.h" |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
50 #include "txt-eng-ft.h" |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
51 |
19909
06979876af7d
Fix compilation error when building without OpenGL
Mike Miller <mtmiller@ieee.org>
parents:
19861
diff
changeset
|
52 #if defined (HAVE_OPENGL) |
06979876af7d
Fix compilation error when building without OpenGL
Mike Miller <mtmiller@ieee.org>
parents:
19861
diff
changeset
|
53 |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
54 class |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7874
diff
changeset
|
55 OCTINTERP_API |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
56 opengl_renderer |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
57 { |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
58 public: |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
59 opengl_renderer (void) |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
60 : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
61 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
62 camera_pos (), camera_dir () |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
63 #if HAVE_FREETYPE |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
64 , text_renderer () |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
65 #endif |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
66 { } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
67 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
68 virtual ~opengl_renderer (void) { } |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
69 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
70 virtual void draw (const graphics_object& go, bool toplevel = true); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
71 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
72 virtual void draw (const Matrix& hlist, bool toplevel = false) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
73 { |
20232
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
19909
diff
changeset
|
74 int len = hlist.numel (); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
75 |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
76 for (int i = len-1; i >= 0; i--) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
77 { |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
78 graphics_object obj = gh_manager::get_object (hlist(i)); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
79 |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
80 if (obj) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
81 draw (obj, toplevel); |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
82 } |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
83 } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
84 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
85 virtual void set_viewport (int w, int h); |
11455
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
10346
diff
changeset
|
86 virtual graphics_xform get_transform (void) const { return xform; } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
87 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
88 protected: |
9798
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
89 virtual void draw_figure (const figure::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
90 virtual void draw_axes (const axes::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
91 virtual void draw_line (const line::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
92 virtual void draw_surface (const surface::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
93 virtual void draw_patch (const patch::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
94 virtual void draw_hggroup (const hggroup::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
95 virtual void draw_text (const text::properties& props); |
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
96 virtual void draw_image (const image::properties& props); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
97 virtual void draw_uipanel (const uipanel::properties& props, |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
98 const graphics_object& go); |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
99 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
12334
diff
changeset
|
100 virtual void init_gl_context (bool enhanced, const Matrix& backgroundColor); |
14836
a1e1f914ae79
Make some opengl_renderer methods virtual.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
14138
diff
changeset
|
101 virtual void setup_opengl_transformation (const axes::properties& props); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
102 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
103 virtual void set_color (const Matrix& c); |
19713
1a6fa5a523e4
Correctly use GL2PS_POLYGON_OFFSET_FILL (bug #44111, bug #44125).
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
104 virtual void set_polygon_offset (bool on, float offset = 0.0f); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
105 virtual void set_linewidth (float w); |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
106 virtual void set_linestyle (const std::string& s, bool stipple = false); |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
107 virtual void set_clipbox (double x1, double x2, double y1, double y2, |
10313 | 108 double z1, double z2); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
109 virtual void set_clipping (bool on); |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
110 virtual void set_font (const base_properties& props); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
111 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
112 virtual void init_marker (const std::string& m, double size, float width); |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
113 virtual void end_marker (void); |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
114 virtual void draw_marker (double x, double y, double z, |
10313 | 115 const Matrix& lc, const Matrix& fc); |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
116 |
9834
92d8f35ff217
compute bounding boxes for text in opengl graphics backend
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9798
diff
changeset
|
117 virtual void text_to_pixels (const std::string& txt, |
10313 | 118 uint8NDArray& pixels, |
119 Matrix& bbox, | |
11455
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
10346
diff
changeset
|
120 int halign = 0, int valign = 0, |
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
10346
diff
changeset
|
121 double rotation = 0.0); |
9834
92d8f35ff217
compute bounding boxes for text in opengl graphics backend
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9798
diff
changeset
|
122 |
9798
2d6a5af744b6
printing for fltk backend using gl2ps
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
123 virtual Matrix render_text (const std::string& txt, |
10313 | 124 double x, double y, double z, |
125 int halign, int valign, double rotation = 0.0); | |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
126 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
127 virtual void draw_pixels (GLsizei w, GLsizei h, GLenum format, |
10313 | 128 GLenum type, const GLvoid *data); |
9950
7dedfd70dd9f
image printing for fltk backend
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9941
diff
changeset
|
129 |
12321
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
130 virtual void render_grid (const std::string& gridstyle, const Matrix& ticks, |
12126
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
131 double lim1, double lim2, |
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
132 double p1, double p1N, double p2, double p2N, |
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
133 int xyz, bool is_3D); |
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
134 |
12321
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
135 virtual void render_tickmarks (const Matrix& ticks, double lim1, double lim2, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
136 double p1, double p1N, double p2, double p2N, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
137 double dx, double dy, double dz, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
138 int xyz, bool doubleside); |
12126
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
139 |
12321
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
140 virtual void render_ticktexts (const Matrix& ticks, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
141 const string_vector& ticklabels, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
142 double lim1, double lim2, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
143 double p1, double p2, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
144 int xyz, int ha, int va, |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
145 int& wmax, int& hmax); |
12126
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
146 |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
147 private: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
148 opengl_renderer (const opengl_renderer&) |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
149 : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
150 zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
151 camera_pos (), camera_dir () |
11584
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
152 #if HAVE_FREETYPE |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
153 , text_renderer () |
cda4aa780d58
Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11576
diff
changeset
|
154 #endif |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
155 { } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
156 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
157 opengl_renderer& operator = (const opengl_renderer&) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
158 { return *this; } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
159 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
160 bool is_nan_or_inf (double x, double y, double z) const |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
161 { |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
162 return (xisnan (x) || xisnan (y) || xisnan (z) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
163 || xisinf (x) || xisinf (y) || xisinf (z)); |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
164 } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
165 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
166 octave_uint8 clip_code (double x, double y, double z) const |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
167 { |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
168 return ((x < xmin ? 1 : 0) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
169 | (x > xmax ? 1 : 0) << 1 |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
170 | (y < ymin ? 1 : 0) << 2 |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
171 | (y > ymax ? 1 : 0) << 3 |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
172 | (z < zmin ? 1 : 0) << 4 |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
173 | (z > zmax ? 1 : 0) << 5 |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
174 | (is_nan_or_inf (x, y, z) ? 0 : 1) << 6); |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19713
diff
changeset
|
175 } |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
176 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
177 unsigned int make_marker_list (const std::string& m, double size, |
10313 | 178 bool filled) const; |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
179 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
180 void draw_axes_planes (const axes::properties& props); |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
181 void draw_axes_boxes (const axes::properties& props); |
12321
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
182 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
183 void draw_axes_x_grid (const axes::properties& props); |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
184 void draw_axes_y_grid (const axes::properties& props); |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
185 void draw_axes_z_grid (const axes::properties& props); |
12321
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
186 |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
187 void draw_axes_children (const axes::properties& props); |
6ba28900706b
opengl_renderer::draw_axes: simplify with subfunctions
John W. Eaton <jwe@octave.org>
parents:
12126
diff
changeset
|
188 |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
189 private: |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
190 // The graphics toolkit associated with the figure being rendered. |
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
191 graphics_toolkit toolkit; |
7869 | 192 |
193 // axes transformation data | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
194 graphics_xform xform; |
7869 | 195 |
196 // axis limits in model scaled coordinate | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
197 double xmin, xmax; |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
198 double ymin, ymax; |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
199 double zmin, zmax; |
7869 | 200 |
201 // Z projection limits in windows coordinate | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
202 double xZ1, xZ2; |
7869 | 203 |
204 // call lists identifiers for markers | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
205 unsigned int marker_id, filled_marker_id; |
7869 | 206 |
207 // camera information for primitive sorting | |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
208 ColumnVector camera_pos, camera_dir; |
7833
8ff92634982d
Add initial support for patch rendering through GLU tessellation (no transparency, no border, no markers yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7829
diff
changeset
|
209 |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
210 #if HAVE_FREETYPE |
18736
333901476119
maint: Use "FreeType" rather than "freetype" in messages and comments.
Rik <rik@octave.org>
parents:
17822
diff
changeset
|
211 // FreeType render, used for text rendering |
9403
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
212 ft_render text_renderer; |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
213 #endif |
4af6e29449c1
[mq]: graphics_text_engine
Michael Goffioul <michael.goffioul@gmail.com>
parents:
8920
diff
changeset
|
214 |
7833
8ff92634982d
Add initial support for patch rendering through GLU tessellation (no transparency, no border, no markers yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7829
diff
changeset
|
215 private: |
8ff92634982d
Add initial support for patch rendering through GLU tessellation (no transparency, no border, no markers yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7829
diff
changeset
|
216 class patch_tesselator; |
7825
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
217 }; |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
218 |
13871b7de124
Import sources for OpenGL-based renderer.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
diff
changeset
|
219 #endif |
19909
06979876af7d
Fix compilation error when building without OpenGL
Mike Miller <mtmiller@ieee.org>
parents:
19861
diff
changeset
|
220 |
06979876af7d
Fix compilation error when building without OpenGL
Mike Miller <mtmiller@ieee.org>
parents:
19861
diff
changeset
|
221 #endif |