Mercurial > octave
annotate libinterp/corefcn/graphics.in.h @ 31241:5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
* graphics.in.h (children_property::do_set): Avoid using a temporary variable
for new children list. Rephrase error message to be more accurate.
Always return true for clarity.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Tue, 27 Sep 2022 23:30:54 +0200 |
parents | 67cad4e8f866 |
children | 9a0ce9eea1b7 e88a07dec498 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30390
diff
changeset
|
3 // Copyright (C) 2007-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
6874 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
26 #if ! defined (octave_graphics_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
27 #define octave_graphics_h 1 |
6874 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21209
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21209
diff
changeset
|
30 |
6874 | 31 #include <cctype> |
23639 | 32 #include <cmath> |
6874 | 33 |
34 #include <algorithm> | |
35 #include <list> | |
36 #include <map> | |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
37 #include <memory> |
6874 | 38 #include <set> |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
39 #include <sstream> |
6874 | 40 #include <string> |
30299
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
41 #include <unordered_map> |
27798
8c1cb06468db
Change class of coplanar_last_idx for patch objects (bug #55895).
Markus Mützel <markus.muetzel@gmx.de>
parents:
27734
diff
changeset
|
42 #include <vector> |
6874 | 43 |
11075
4e31d44a9763
extract caseless_str class to separate header file
John W. Eaton <jwe@octave.org>
parents:
11074
diff
changeset
|
44 #include "caseless-str.h" |
9004
17ba311ef110
add one more missing include
Jaroslav Hajek <highegg@gmail.com>
parents:
8944
diff
changeset
|
45 |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21055
diff
changeset
|
46 #include "errwarn.h" |
23774
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23763
diff
changeset
|
47 #include "graphics-handle.h" |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23763
diff
changeset
|
48 #include "graphics-toolkit.h" |
6874 | 49 #include "oct-map.h" |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
50 #include "oct-mutex.h" |
13985
43cc49c7abd1
Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13938
diff
changeset
|
51 #include "oct-refcount.h" |
6874 | 52 #include "ov.h" |
21209
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
53 #include "text-renderer.h" |
6874 | 54 |
29993
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
55 OCTAVE_NAMESPACE_BEGIN |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
56 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
57 // FIXME: maybe this should be a configure option? |
8944
cb0e9facc342
make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
58 // Matlab defaults to "Helvetica", but that causes problems for many |
cb0e9facc342
make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
59 // gnuplot users. |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20785
diff
changeset
|
60 #if ! defined (OCTAVE_DEFAULT_FONTNAME) |
8944
cb0e9facc342
make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
61 #define OCTAVE_DEFAULT_FONTNAME "*" |
cb0e9facc342
make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
62 #endif |
cb0e9facc342
make default fontname * instead of Helvetica
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
63 |
6874 | 64 // --------------------------------------------------------------------- |
65 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
66 class OCTINTERP_API base_scaler |
7427 | 67 { |
68 public: | |
69 base_scaler (void) { } | |
70 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
71 virtual ~base_scaler (void) = default; |
7440 | 72 |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
73 virtual Matrix scale (const Matrix&) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
74 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
75 error ("invalid axis scale"); |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
76 } |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
77 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
78 virtual NDArray scale (const NDArray&) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
79 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
80 error ("invalid axis scale"); |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
81 } |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
82 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
83 virtual double scale (double) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
84 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 error ("invalid axis scale"); |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
86 } |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
87 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
88 virtual double unscale (double) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
89 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 error ("invalid axis scale"); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
91 } |
7427 | 92 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
93 virtual base_scaler * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
94 { return new base_scaler (); } |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
95 |
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
96 virtual bool is_linear (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
97 { return false; } |
7427 | 98 }; |
99 | |
100 class lin_scaler : public base_scaler | |
101 { | |
102 public: | |
103 lin_scaler (void) { } | |
104 | |
105 Matrix scale (const Matrix& m) const { return m; } | |
106 | |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
107 NDArray scale (const NDArray& m) const { return m; } |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
108 |
7427 | 109 double scale (double d) const { return d; } |
110 | |
111 double unscale (double d) const { return d; } | |
112 | |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
113 base_scaler * clone (void) const { return new lin_scaler (); } |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
114 |
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
115 bool is_linear (void) const { return true; } |
7427 | 116 }; |
117 | |
118 class log_scaler : public base_scaler | |
119 { | |
120 public: | |
121 log_scaler (void) { } | |
122 | |
123 Matrix scale (const Matrix& m) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
124 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
125 Matrix retval (m.rows (), m.cols ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
126 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
127 do_scale (m.data (), retval.fortran_vec (), m.numel ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
128 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
129 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
130 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
131 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
132 NDArray scale (const NDArray& m) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
133 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
134 NDArray retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
135 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
136 do_scale (m.data (), retval.fortran_vec (), m.numel ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
137 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
139 } |
7427 | 140 |
141 double scale (double d) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 { return log10 (d); } |
7427 | 143 |
144 double unscale (double d) const | |
23639 | 145 { return std::pow (10.0, d); } |
7427 | 146 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
147 base_scaler * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
148 { return new log_scaler (); } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
149 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
150 private: |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
151 void do_scale (const double *src, double *dest, int n) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
152 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
153 for (int i = 0; i < n; i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
154 dest[i] = log10 (src[i]); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
155 } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
156 }; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
157 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
158 class OCTINTERP_API neg_log_scaler : public base_scaler |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
159 { |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
160 public: |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
161 neg_log_scaler (void) { } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
162 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
163 Matrix scale (const Matrix& m) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
164 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
165 Matrix retval (m.rows (), m.cols ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
166 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
167 do_scale (m.data (), retval.fortran_vec (), m.numel ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
168 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
169 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
170 } |
13756
6dfebfa334cb
allow negative data log plots with OpenGL+FLTK graphics (bug #34232)
John W. Eaton <jwe@octave.org>
parents:
13722
diff
changeset
|
171 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
172 NDArray scale (const NDArray& m) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 NDArray retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
175 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
176 do_scale (m.data (), retval.fortran_vec (), m.numel ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
177 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
178 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
179 } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
180 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
181 double scale (double d) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
182 { return -log10 (-d); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
183 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
184 double unscale (double d) const |
23639 | 185 { return -std::pow (10.0, -d); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
186 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
187 base_scaler * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
188 { return new neg_log_scaler (); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
189 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
190 private: |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
191 void do_scale (const double *src, double *dest, int n) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
192 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
193 for (int i = 0; i < n; i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
194 dest[i] = -log10 (-src[i]); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
195 } |
7427 | 196 }; |
197 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
198 class OCTINTERP_API scaler |
7427 | 199 { |
200 public: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
201 scaler (void) : m_rep (new base_scaler ()) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
202 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
203 scaler (const scaler& s) : m_rep (s.m_rep->clone ()) { } |
7427 | 204 |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
205 scaler (const std::string& s) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
206 : m_rep (s == "log" |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
207 ? new log_scaler () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
208 : (s == "neglog" |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
209 ? new neg_log_scaler () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
210 : (s == "linear" |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
211 ? new lin_scaler () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
212 : new base_scaler ()))) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
213 { } |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
214 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
215 ~scaler (void) { delete m_rep; } |
7427 | 216 |
217 Matrix scale (const Matrix& m) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
218 { return m_rep->scale (m); } |
7427 | 219 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
220 NDArray scale (const NDArray& m) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
221 { return m_rep->scale (m); } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
222 |
7427 | 223 double scale (double d) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
224 { return m_rep->scale (d); } |
7427 | 225 |
226 double unscale (double d) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
227 { return m_rep->unscale (d); } |
7427 | 228 |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
229 bool is_linear (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
230 { return m_rep->is_linear (); } |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
231 |
7427 | 232 scaler& operator = (const scaler& s) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
233 { |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
234 if (&s != this) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
235 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
236 if (m_rep) |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
237 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
238 delete m_rep; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
239 m_rep = nullptr; |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
240 } |
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
241 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
242 m_rep = s.m_rep->clone (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
243 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
244 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
245 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
246 } |
7427 | 247 |
248 scaler& operator = (const std::string& s) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
249 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
250 if (m_rep) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
251 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
252 delete m_rep; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
253 m_rep = nullptr; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
254 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
255 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
256 if (s == "log") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
257 m_rep = new log_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
258 else if (s == "neglog") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
259 m_rep = new neg_log_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
260 else if (s == "linear") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
261 m_rep = new lin_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
262 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
263 m_rep = new base_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
264 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
265 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
266 } |
7427 | 267 |
268 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
269 base_scaler *m_rep; |
7427 | 270 }; |
271 | |
272 // --------------------------------------------------------------------- | |
273 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
274 class OCTINTERP_API property; |
7363 | 275 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
276 // FIXME: These values should probably be defined inside a namespace or |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
277 // class, but which one is most appropriate? For now, prefix with |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
278 // "GCB_" to avoid conflict with PERSISTENT token ID used in the lexer. |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
279 // The lexer token IDs should probably also be fixed... |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
280 |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
281 enum listener_mode { GCB_POSTSET, GCB_PERSISTENT, GCB_PREDELETE }; |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
282 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
283 class OCTINTERP_API base_property |
7363 | 284 { |
285 public: | |
286 friend class property; | |
287 | |
288 public: | |
12174 | 289 base_property (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
290 : m_id (-1), m_count (1), m_name (), m_parent (), m_hidden (), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
291 m_listeners () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
292 { } |
7363 | 293 |
294 base_property (const std::string& s, const graphics_handle& h) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
295 : m_id (-1), m_count (1), m_name (s), m_parent (h), m_hidden (false), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
296 m_listeners () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
297 { } |
7363 | 298 |
299 base_property (const base_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
300 : m_id (-1), m_count (1), m_name (p.m_name), m_parent (p.m_parent), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
301 m_hidden (p.m_hidden), m_listeners () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
302 { } |
7363 | 303 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
304 virtual ~base_property (void) = default; |
7363 | 305 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
306 bool ok (void) const { return m_parent.ok (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
307 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
308 std::string get_name (void) const { return m_name; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
309 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
310 void set_name (const std::string& s) { m_name = s; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
311 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
312 graphics_handle get_parent (void) const { return m_parent; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
313 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
314 void set_parent (const graphics_handle& h) { m_parent = h; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
315 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
316 bool is_hidden (void) const { return m_hidden; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
317 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
318 void set_hidden (bool flag) { m_hidden = flag; } |
7363 | 319 |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
320 virtual bool is_radio (void) const { return false; } |
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
321 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
322 int get_id (void) const { return m_id; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
323 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
324 void set_id (int d) { m_id = d; } |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
325 |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
326 // Sets property value, notifies graphics toolkit. |
8058
ca39c21fa4b8
[mq]: generic_octave_to_backend_nofitication
John W. Eaton <jwe@octave.org>
parents:
8052
diff
changeset
|
327 // If do_run is true, runs associated listeners. |
13321
5ea207067ee5
Export base_property::set.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13307
diff
changeset
|
328 OCTINTERP_API bool set (const octave_value& v, bool do_run = true, |
5ea207067ee5
Export base_property::set.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13307
diff
changeset
|
329 bool do_notify_toolkit = true); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
330 |
7363 | 331 virtual octave_value get (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
332 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
333 error (R"(get: invalid property "%s")", m_name.c_str ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
334 } |
7363 | 335 |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
336 virtual std::string values_as_string (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
337 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
338 error (R"(values_as_string: invalid property "%s")", m_name.c_str ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
339 } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
340 |
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
341 virtual Cell values_as_cell (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
342 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
343 error (R"(values_as_cell: invalid property "%s")", m_name.c_str ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
344 } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
345 |
7363 | 346 base_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
347 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
348 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
349 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
350 } |
7363 | 351 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
352 void add_listener (const octave_value& v, listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
353 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
354 octave_value_list& l = m_listeners[mode]; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
355 l.resize (l.length () + 1, v); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
356 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
357 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
358 void delete_listener (const octave_value& v = octave_value (), |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
359 listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
360 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
361 octave_value_list& l = m_listeners[mode]; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
362 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
363 if (v.is_defined ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
364 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
365 bool found = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
366 int i; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
367 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
368 for (i = 0; i < l.length (); i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
369 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
370 if (v.internal_rep () == l(i).internal_rep ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
371 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
372 found = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
373 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
374 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
375 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
376 if (found) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
377 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
378 for (int j = i; j < l.length () - 1; j++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
379 l(j) = l(j + 1); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
380 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
381 l.resize (l.length () - 1); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
382 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
383 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
384 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
385 { |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
386 if (mode == GCB_PERSISTENT) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
387 l.resize (0); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
388 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
389 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
390 octave_value_list lnew (0); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
391 octave_value_list& lp = m_listeners[GCB_PERSISTENT]; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
392 for (int i = l.length () - 1; i >= 0 ; i--) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
393 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
394 for (int j = 0; j < lp.length (); j++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
395 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
396 if (l(i).internal_rep () == lp(j).internal_rep ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
397 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
398 lnew.resize (lnew.length () + 1, l(i)); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
399 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
400 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
401 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
402 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
403 l = lnew; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
404 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
405 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
406 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
407 } |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
408 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
409 OCTINTERP_API void run_listeners (listener_mode mode = GCB_POSTSET); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
410 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
411 virtual base_property * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
412 { return new base_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
413 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
414 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
415 virtual bool do_set (const octave_value&) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
416 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
417 error (R"(set: invalid property "%s")", m_name.c_str ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
418 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
419 |
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
420 private: |
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
421 typedef std::map<listener_mode, octave_value_list> listener_map; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
422 typedef std::map<listener_mode, octave_value_list>::iterator |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
423 listener_map_iterator; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
424 typedef std::map<listener_mode, octave_value_list>::const_iterator |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
425 listener_map_const_iterator; |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
426 |
7363 | 427 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
428 int m_id; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
429 octave::refcount<octave_idx_type> m_count; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
430 std::string m_name; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
431 graphics_handle m_parent; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
432 bool m_hidden; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
433 listener_map m_listeners; |
7363 | 434 }; |
435 | |
436 // --------------------------------------------------------------------- | |
437 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
438 class OCTINTERP_API string_property : public base_property |
7363 | 439 { |
440 public: | |
441 string_property (const std::string& s, const graphics_handle& h, | |
442 const std::string& val = "") | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
443 : base_property (s, h), m_str (val) { } |
7363 | 444 |
445 string_property (const string_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
446 : base_property (p), m_str (p.m_str) { } |
7363 | 447 |
448 octave_value get (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
449 { return octave_value (m_str); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
450 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
451 std::string string_value (void) const { return m_str; } |
7363 | 452 |
453 string_property& operator = (const octave_value& val) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
454 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
455 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
456 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
457 } |
7363 | 458 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
459 base_property * clone (void) const { return new string_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
460 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
461 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
462 bool do_set (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
463 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
464 if (! val.is_string ()) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
465 error (R"(set: invalid string property value for "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
466 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
467 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
468 std::string new_str = val.string_value (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
469 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
470 if (new_str != m_str) |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
471 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
472 m_str = new_str; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
473 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
474 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
475 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
476 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
477 |
7363 | 478 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
479 std::string m_str; |
7363 | 480 }; |
481 | |
482 // --------------------------------------------------------------------- | |
483 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
484 class OCTINTERP_API string_array_property : public base_property |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
485 { |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
486 public: |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
487 enum desired_enum { string_t, cell_t }; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
488 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
489 string_array_property (const std::string& s, const graphics_handle& h, |
16890
830f27544bb7
Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents:
16832
diff
changeset
|
490 const std::string& val = "", const char& sep = '|', |
830f27544bb7
Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents:
16832
diff
changeset
|
491 const desired_enum& typ = string_t) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
492 : base_property (s, h), m_desired_type (typ), m_separator (sep), m_str () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
493 { |
29654
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
494 std::size_t pos = 0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
495 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
496 while (true) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
497 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
498 std::size_t new_pos = val.find_first_of (m_separator, pos); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
499 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
500 if (new_pos == std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
501 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
502 m_str.append (val.substr (pos)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
503 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
504 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
505 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
506 m_str.append (val.substr (pos, new_pos - pos)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
507 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
508 pos = new_pos + 1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
509 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
510 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
511 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
512 string_array_property (const std::string& s, const graphics_handle& h, |
16890
830f27544bb7
Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents:
16832
diff
changeset
|
513 const Cell& c, const char& sep = '|', |
830f27544bb7
Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents:
16832
diff
changeset
|
514 const desired_enum& typ = string_t) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
515 : base_property (s, h), m_desired_type (typ), m_separator (sep), m_str () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
516 { |
23575
e95738a119da
maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents:
23564
diff
changeset
|
517 if (! c.iscellstr ()) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
518 error (R"(set: invalid order property value for "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
519 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
520 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
521 string_vector strings (c.numel ()); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
522 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
523 for (octave_idx_type i = 0; i < c.numel (); i++) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
524 strings[i] = c(i).string_value (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
525 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
526 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
527 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
528 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
529 string_array_property (const string_array_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
530 : base_property (p), m_desired_type (p.m_desired_type), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
531 m_separator (p.m_separator), m_str (p.m_str) { } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
532 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
533 octave_value get (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
534 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
535 if (m_desired_type == string_t) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
536 return octave_value (string_value ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
537 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
538 return octave_value (cell_value ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
539 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
540 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
541 std::string string_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
542 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
543 std::string s; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
544 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
545 for (octave_idx_type i = 0; i < m_str.numel (); i++) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
546 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
547 s += m_str[i]; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
548 if (i != m_str.numel () - 1) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
549 s += m_separator; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
550 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
551 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
552 return s; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
553 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
554 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
555 Cell cell_value (void) const {return Cell (m_str);} |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
556 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
557 string_vector string_vector_value (void) const { return m_str; } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
558 |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
559 string_array_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
560 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
561 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
562 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
563 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
564 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
565 base_property * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
566 { return new string_array_property (*this); } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
567 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
568 protected: |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
569 bool do_set (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
570 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
571 if (val.is_string () && val.rows () == 1) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
572 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
573 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
574 std::string new_str = val.string_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
575 string_vector strings; |
29654
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
576 std::size_t pos = 0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
577 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
578 // Split single string on delimiter (usually '|') |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
579 while (pos != std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
580 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
581 std::size_t new_pos = new_str.find_first_of (m_separator, pos); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
582 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
583 if (new_pos == std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
584 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
585 strings.append (new_str.substr (pos)); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
586 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
587 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
588 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
589 strings.append (new_str.substr (pos, new_pos - pos)); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
590 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
591 pos = new_pos + 1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
592 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
593 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
594 if (m_str.numel () == strings.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
595 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
596 for (octave_idx_type i = 0; i < m_str.numel (); i++) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
597 if (strings[i] != m_str[i]) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
598 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
599 replace = true; |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
600 break; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
601 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
602 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
603 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
604 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
605 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
606 m_desired_type = string_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
607 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
608 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
609 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
610 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
611 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
612 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
613 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
614 else if (val.is_string ()) // multi-row character matrix |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
615 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
616 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
617 charMatrix chm = val.char_matrix_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
618 octave_idx_type nel = chm.rows (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
619 string_vector strings (nel); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
620 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
621 if (nel != m_str.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
622 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
623 for (octave_idx_type i = 0; i < nel; i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
624 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
625 strings[i] = chm.row_as_string (i); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
626 if (! replace && strings[i] != m_str[i]) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
627 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
628 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
629 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
630 m_desired_type = string_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
631 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
632 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
633 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
634 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
635 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
636 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
637 } |
23575
e95738a119da
maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents:
23564
diff
changeset
|
638 else if (val.iscellstr ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
639 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
640 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
641 Cell new_cell = val.cell_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
642 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
643 string_vector strings = new_cell.cellstr_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
644 |
20232
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20181
diff
changeset
|
645 octave_idx_type nel = strings.numel (); |
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20181
diff
changeset
|
646 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
647 if (nel != m_str.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
648 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
649 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
650 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
651 for (octave_idx_type i = 0; i < nel; i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
652 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
653 if (strings[i] != m_str[i]) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
654 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
655 replace = true; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
656 break; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
657 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
658 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
659 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
660 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
661 m_desired_type = cell_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
662 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
663 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
664 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
665 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
666 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
667 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
668 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
669 else |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
670 error (R"(set: invalid string property value for "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
671 get_name ().c_str ()); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
672 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
673 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
674 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
675 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
676 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
677 desired_enum m_desired_type; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
678 char m_separator; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
679 string_vector m_str; |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
680 }; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
681 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
682 // --------------------------------------------------------------------- |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
683 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
684 class OCTINTERP_API text_label_property : public base_property |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
685 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
686 public: |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
687 enum type { char_t, cellstr_t }; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
688 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
689 text_label_property (const std::string& s, const graphics_handle& h, |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
690 const std::string& val = "") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
691 : base_property (s, h), m_value (val), m_stored_type (char_t) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
692 { } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
693 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
694 text_label_property (const std::string& s, const graphics_handle& h, |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
695 const NDArray& nda) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
696 : base_property (s, h), m_stored_type (char_t) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
697 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
698 octave_idx_type nel = nda.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
699 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
700 m_value.resize (nel); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
701 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
702 for (octave_idx_type i = 0; i < nel; i++) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
703 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
704 std::ostringstream buf; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
705 buf << nda(i); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
706 m_value[i] = buf.str (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
707 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
708 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
709 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
710 text_label_property (const std::string& s, const graphics_handle& h, |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
711 const Cell& c) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
712 : base_property (s, h), m_stored_type (cellstr_t) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
713 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
714 octave_idx_type nel = c.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
715 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
716 m_value.resize (nel); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
717 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
718 for (octave_idx_type i = 0; i < nel; i++) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
719 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
720 octave_value tmp = c(i); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
721 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
722 if (tmp.is_string ()) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
723 m_value[i] = c(i).string_value (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
724 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
725 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
726 double d = c(i).double_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
727 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
728 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
729 buf << d; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
730 m_value[i] = buf.str (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
731 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
732 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
733 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
734 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
735 text_label_property (const text_label_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
736 : base_property (p), m_value (p.m_value), m_stored_type (p.m_stored_type) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
737 { } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
738 |
12965
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
739 bool empty (void) const |
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
740 { |
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
741 octave_value tmp = get (); |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
742 return tmp.isempty (); |
12965
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
743 } |
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
744 |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
745 octave_value get (void) const |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
746 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
747 if (m_stored_type == char_t) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
748 return octave_value (char_value ()); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
749 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
750 return octave_value (cell_value ()); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
751 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
752 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
753 std::string string_value (void) const |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
754 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
755 return m_value.empty () ? "" : m_value[0]; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
756 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
757 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
758 string_vector string_vector_value (void) const { return m_value; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
759 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
760 charMatrix char_value (void) const { return charMatrix (m_value, ' '); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
761 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
762 Cell cell_value (void) const {return Cell (m_value); } |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
763 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
764 text_label_property& operator = (const octave_value& val) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
765 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
766 set (val); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
767 return *this; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
768 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
769 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
770 base_property * clone (void) const { return new text_label_property (*this); } |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
771 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
772 protected: |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
773 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
774 bool do_set (const octave_value& val) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
775 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
776 if (val.is_string ()) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
777 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
778 m_value = val.string_vector_value (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
779 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
780 m_stored_type = char_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
781 } |
23576
00e518162fda
maint: Deprecate is_cell and replace with iscell.
Rik <rik@octave.org>
parents:
23575
diff
changeset
|
782 else if (val.iscell ()) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
783 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
784 Cell c = val.cell_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
785 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
786 octave_idx_type nel = c.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
787 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
788 m_value.resize (nel); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
789 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
790 for (octave_idx_type i = 0; i < nel; i++) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
791 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
792 octave_value tmp = c(i); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
793 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
794 if (tmp.is_string ()) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
795 m_value[i] = c(i).string_value (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
796 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
797 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
798 double d = c(i).double_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
799 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
800 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
801 buf << d; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
802 m_value[i] = buf.str (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
803 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
804 } |
12965
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
805 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
806 m_stored_type = cellstr_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
807 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
808 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
809 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
810 NDArray nda; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
811 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
812 try |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
813 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
814 nda = val.array_value (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
815 } |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
816 catch (octave::execution_exception& ee) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
817 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
818 error (ee, R"(set: invalid string property value for "%s")", |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
819 get_name ().c_str ()); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
820 } |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
821 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
822 octave_idx_type nel = nda.numel (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
823 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
824 m_value.resize (nel); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
825 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
826 for (octave_idx_type i = 0; i < nel; i++) |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
827 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
828 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
829 buf << nda(i); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
830 m_value[i] = buf.str (); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
831 } |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
832 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
833 m_stored_type = char_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
834 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
835 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
836 return true; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
837 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
838 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
839 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
840 string_vector m_value; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
841 type m_stored_type; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
842 }; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
843 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
844 // --------------------------------------------------------------------- |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
845 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
846 class OCTINTERP_API radio_values |
7363 | 847 { |
848 public: | |
21017
93748bcaec17
maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents:
20990
diff
changeset
|
849 OCTINTERP_API radio_values (const std::string& opt_string = ""); |
7363 | 850 |
851 radio_values (const radio_values& a) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
852 : m_default_val (a.m_default_val), m_possible_vals (a.m_possible_vals) { } |
7363 | 853 |
854 radio_values& operator = (const radio_values& a) | |
855 { | |
856 if (&a != this) | |
857 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
858 m_default_val = a.m_default_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
859 m_possible_vals = a.m_possible_vals; |
7363 | 860 } |
861 | |
862 return *this; | |
863 } | |
864 | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
865 std::string default_value (void) const { return m_default_val; } |
7363 | 866 |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
867 bool validate (const std::string& val, std::string& match) |
7363 | 868 { |
869 bool retval = true; | |
870 | |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
871 if (! contains (val, match)) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
872 error ("invalid value = %s", val.c_str ()); |
7363 | 873 |
874 return retval; | |
875 } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
876 |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
877 bool contains (const std::string& val, std::string& match) |
7363 | 878 { |
29654
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
879 std::size_t k = 0; |
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
880 |
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
881 std::size_t len = val.length (); |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
882 |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
883 std::string first_match; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
884 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
885 for (const auto& possible_val : m_possible_vals) |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
886 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
887 if (possible_val.compare (val, len)) |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
888 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
889 if (len == possible_val.length ()) |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
890 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
891 // We found a full match (consider the case of val == "replace" |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
892 // with possible values "replace" and "replacechildren"). Any |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
893 // other matches are irrelevant, so set match and return now. |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
894 match = possible_val; |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
895 return true; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
896 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
897 else |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
898 { |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
899 if (k == 0) |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
900 first_match = possible_val; |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
901 |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
902 k++; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
903 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
904 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
905 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
906 |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
907 if (k == 1) |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
908 { |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
909 match = first_match; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
910 return true; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
911 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
912 else |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
913 return false; |
7363 | 914 } |
915 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
916 OCTINTERP_API std::string values_as_string (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
917 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
918 OCTINTERP_API Cell values_as_cell (void) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
919 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
920 octave_idx_type nelem (void) const { return m_possible_vals.size (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
921 |
7363 | 922 private: |
923 // Might also want to cache | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
924 std::string m_default_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
925 std::set<caseless_str> m_possible_vals; |
7363 | 926 }; |
927 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
928 class OCTINTERP_API radio_property : public base_property |
7363 | 929 { |
930 public: | |
7364 | 931 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 932 const radio_values& v = radio_values ()) |
7364 | 933 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
934 m_vals (v), m_current_val (v.default_value ()) { } |
7363 | 935 |
7364 | 936 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 937 const std::string& v) |
7364 | 938 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
939 m_vals (v), m_current_val (m_vals.default_value ()) { } |
7363 | 940 |
7364 | 941 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 942 const radio_values& v, const std::string& def) |
7364 | 943 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
944 m_vals (v), m_current_val (def) { } |
7363 | 945 |
946 radio_property (const radio_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
947 : base_property (p), m_vals (p.m_vals), m_current_val (p.m_current_val) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
948 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
949 octave_value get (void) const { return octave_value (m_current_val); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
950 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
951 const std::string& current_value (void) const { return m_current_val; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
952 |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
953 std::string values_as_string (void) const |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
954 { return m_vals.values_as_string (); } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
955 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
956 Cell values_as_cell (void) const { return m_vals.values_as_cell (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
957 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
958 bool is (const caseless_str& v) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
959 { return v.compare (m_current_val); } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
960 |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
961 bool is_radio (void) const { return true; } |
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
962 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
963 radio_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
964 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
965 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
966 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
967 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
968 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
969 base_property * clone (void) const { return new radio_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
970 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
971 protected: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
972 bool do_set (const octave_value& newval) |
7363 | 973 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
974 if (! newval.is_string ()) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
975 error (R"(set: invalid value for radio property "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
976 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
977 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
978 std::string s = newval.string_value (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
979 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
980 std::string match; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
981 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
982 if (! m_vals.validate (s, match)) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
983 error (R"(set: invalid value for radio property "%s" (value = %s))", |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
984 get_name ().c_str (), s.c_str ()); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
985 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
986 if (match != m_current_val) |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
987 { |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
988 if (s.length () != match.length ()) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
989 warning_with_id ("Octave:abbreviated-property-match", |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
990 "%s: allowing %s to match %s value %s", |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
991 "set", s.c_str (), get_name ().c_str (), |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
992 match.c_str ()); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
993 m_current_val = match; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
994 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
995 } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
996 return false; |
7363 | 997 } |
998 | |
999 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1000 radio_values m_vals; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1001 std::string m_current_val; |
7363 | 1002 }; |
1003 | |
1004 // --------------------------------------------------------------------- | |
1005 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1006 class OCTINTERP_API color_values |
7363 | 1007 { |
1008 public: | |
1009 color_values (double r = 0, double g = 0, double b = 1) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1010 : m_rgb (1, 3) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1011 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1012 m_rgb(0) = r; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1013 m_rgb(1) = g; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1014 m_rgb(2) = b; |
7363 | 1015 |
1016 validate (); | |
1017 } | |
1018 | |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1019 color_values (const std::string& str) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1020 : m_rgb (1, 3) |
7363 | 1021 { |
1022 if (! str2rgb (str)) | |
1023 error ("invalid color specification: %s", str.c_str ()); | |
1024 } | |
1025 | |
1026 color_values (const color_values& c) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1027 : m_rgb (c.m_rgb) |
7363 | 1028 { } |
1029 | |
1030 color_values& operator = (const color_values& c) | |
1031 { | |
1032 if (&c != this) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1033 m_rgb = c.m_rgb; |
7363 | 1034 |
1035 return *this; | |
1036 } | |
1037 | |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1038 bool operator == (const color_values& c) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1039 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1040 return (m_rgb(0) == c.m_rgb(0) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1041 && m_rgb(1) == c.m_rgb(1) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1042 && m_rgb(2) == c.m_rgb(2)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1043 } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1044 |
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1045 bool operator != (const color_values& c) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1046 { return ! (*this == c); } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1047 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1048 Matrix rgb (void) const { return m_rgb; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1049 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1050 operator octave_value (void) const { return m_rgb; } |
7363 | 1051 |
1052 void validate (void) const | |
1053 { | |
1054 for (int i = 0; i < 3; i++) | |
1055 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1056 if (m_rgb(i) < 0 || m_rgb(i) > 1) |
20730
948f45a2931e
don't check error_state after creating color object
John W. Eaton <jwe@octave.org>
parents:
20726
diff
changeset
|
1057 error ("invalid RGB color specification"); |
7363 | 1058 } |
1059 } | |
1060 | |
1061 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1062 Matrix m_rgb; |
7363 | 1063 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1064 OCTINTERP_API bool str2rgb (const std::string& str); |
7363 | 1065 }; |
1066 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1067 class OCTINTERP_API color_property : public base_property |
7363 | 1068 { |
1069 public: | |
1070 color_property (const color_values& c, const radio_values& v) | |
1071 : base_property ("", graphics_handle ()), | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1072 m_current_type (color_t), m_color_val (c), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1073 m_current_val (v.default_value ()) |
7363 | 1074 { } |
1075 | |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1076 color_property (const radio_values& v, const color_values& c) |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1077 : base_property ("", graphics_handle ()), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1078 m_current_type (radio_t), m_color_val (c), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1079 m_current_val (v.default_value ()) |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1080 { } |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1081 |
7364 | 1082 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1083 const color_values& c = color_values (), |
1084 const radio_values& v = radio_values ()) | |
7364 | 1085 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1086 m_current_type (color_t), m_color_val (c), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1087 m_current_val (v.default_value ()) |
7363 | 1088 { } |
1089 | |
7364 | 1090 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1091 const radio_values& v) |
7364 | 1092 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1093 m_current_type (radio_t), m_color_val (color_values ()), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1094 m_current_val (v.default_value ()) |
7363 | 1095 { } |
1096 | |
7364 | 1097 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1098 const std::string& v) |
7364 | 1099 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1100 m_current_type (radio_t), m_color_val (color_values ()), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1101 m_current_val (m_radio_val.default_value ()) |
7363 | 1102 { } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1103 |
7364 | 1104 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1105 const color_property& v) |
7364 | 1106 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1107 m_current_type (v.m_current_type), m_color_val (v.m_color_val), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1108 m_radio_val (v.m_radio_val), m_current_val (v.m_current_val) |
7363 | 1109 { } |
1110 | |
1111 color_property (const color_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1112 : base_property (p), m_current_type (p.m_current_type), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1113 m_color_val (p.m_color_val), m_radio_val (p.m_radio_val), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1114 m_current_val (p.m_current_val) { } |
7363 | 1115 |
1116 octave_value get (void) const | |
1117 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1118 if (m_current_type == color_t) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1119 return m_color_val.rgb (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1120 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1121 return m_current_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1122 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1123 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1124 bool is_rgb (void) const { return (m_current_type == color_t); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1125 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1126 bool is_radio (void) const { return (m_current_type == radio_t); } |
7363 | 1127 |
1128 bool is (const std::string& v) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1129 { return (is_radio () && m_current_val == v); } |
7363 | 1130 |
1131 Matrix rgb (void) const | |
1132 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1133 if (m_current_type != color_t) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20711
diff
changeset
|
1134 error ("color has no RGB value"); |
7363 | 1135 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1136 return m_color_val.rgb (); |
7363 | 1137 } |
1138 | |
1139 const std::string& current_value (void) const | |
1140 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1141 if (m_current_type != radio_t) |
7363 | 1142 error ("color has no radio value"); |
1143 | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1144 return m_current_val; |
7363 | 1145 } |
1146 | |
1147 color_property& operator = (const octave_value& val) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1148 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1149 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1150 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1151 } |
7363 | 1152 |
1153 operator octave_value (void) const { return get (); } | |
1154 | |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1155 base_property * clone (void) const { return new color_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1156 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1157 std::string values_as_string (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1158 { return m_radio_val.values_as_string (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1159 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1160 Cell values_as_cell (void) const { return m_radio_val.values_as_cell (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1161 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1162 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1163 OCTINTERP_API bool do_set (const octave_value& newval); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1164 |
7363 | 1165 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1166 enum current_enum { color_t, radio_t } m_current_type; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1167 color_values m_color_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1168 radio_values m_radio_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1169 std::string m_current_val; |
7363 | 1170 }; |
1171 | |
1172 // --------------------------------------------------------------------- | |
1173 | |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1174 enum finite_type |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1175 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1176 NO_CHECK, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1177 FINITE, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1178 NOT_NAN, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1179 NOT_INF |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1180 }; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1181 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1182 class OCTINTERP_API double_property : public base_property |
7363 | 1183 { |
1184 public: | |
7364 | 1185 double_property (const std::string& nm, const graphics_handle& h, |
7363 | 1186 double d = 0) |
7364 | 1187 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1188 m_current_val (d), m_finite_constraint (NO_CHECK), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1189 m_minval (std::pair<double, bool> (octave_NaN, true)), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1190 m_maxval (std::pair<double, bool> (octave_NaN, true)) { } |
7363 | 1191 |
1192 double_property (const double_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1193 : base_property (p), m_current_val (p.m_current_val), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1194 m_finite_constraint (NO_CHECK), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1195 m_minval (std::pair<double, bool> (octave_NaN, true)), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1196 m_maxval (std::pair<double, bool> (octave_NaN, true)) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1197 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1198 octave_value get (void) const { return octave_value (m_current_val); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1199 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1200 double double_value (void) const { return m_current_val; } |
7363 | 1201 |
1202 double_property& operator = (const octave_value& val) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1203 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1204 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1205 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1206 } |
7363 | 1207 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1208 base_property * clone (void) const |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1209 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1210 double_property *p = new double_property (*this); |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1211 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1212 p->m_finite_constraint = m_finite_constraint; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1213 p->m_minval = m_minval; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1214 p->m_maxval = m_maxval; |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1215 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1216 return p; |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1217 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1218 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1219 void add_constraint (const std::string& type, double val, bool inclusive) |
22910
23847979b91e
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
1220 { |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1221 if (type == "min") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1222 m_minval = std::pair<double, bool> (val, inclusive); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1223 else if (type == "max") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1224 m_maxval = std::pair<double, bool> (val, inclusive); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1225 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1226 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1227 void add_constraint (const finite_type finite) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1228 { m_finite_constraint = finite; } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1229 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1230 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1231 bool do_set (const octave_value& v) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1232 { |
23582
0cc2011d800e
maint: Deprecate is_real_type and replace with isreal.
Rik <rik@octave.org>
parents:
23577
diff
changeset
|
1233 if (! v.is_scalar_type () || ! v.isreal ()) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1234 error (R"(set: invalid value for double property "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1235 get_name ().c_str ()); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1236 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1237 double new_val = v.double_value (); |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1238 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1239 // Check min and max |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1240 if (! octave::math::isnan (m_minval.first)) |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1241 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1242 if (m_minval.second && m_minval.first > new_val) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1243 error (R"(set: "%s" must be greater than or equal to %g)", |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1244 get_name ().c_str (), m_minval.first); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1245 else if (! m_minval.second && m_minval.first >= new_val) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1246 error (R"(set: "%s" must be greater than %g)", |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1247 get_name ().c_str (), m_minval.first); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1248 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1249 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1250 if (! octave::math::isnan (m_maxval.first)) |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1251 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1252 if (m_maxval.second && m_maxval.first < new_val) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1253 error (R"(set: "%s" must be less than or equal to %g)", |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1254 get_name ().c_str (), m_maxval.first); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1255 else if (! m_maxval.second && m_maxval.first <= new_val) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1256 error (R"(set: "%s" must be less than %g)", |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1257 get_name ().c_str (), m_maxval.first); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1258 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1259 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1260 if (m_finite_constraint == NO_CHECK) { /* do nothing */ } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1261 else if (m_finite_constraint == FINITE) |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1262 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1263 if (! octave::math::isfinite (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1264 error (R"(set: "%s" must be finite)", get_name ().c_str ()); |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1265 } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1266 else if (m_finite_constraint == NOT_NAN) |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1267 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1268 if (octave::math::isnan (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1269 error (R"(set: "%s" must not be nan)", get_name ().c_str ()); |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1270 } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1271 else if (m_finite_constraint == NOT_INF) |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1272 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1273 if (octave::math::isinf (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1274 error (R"(set: "%s" must not be infinite)", get_name ().c_str ()); |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1275 } |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1276 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1277 if (new_val != m_current_val) |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1278 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1279 m_current_val = new_val; |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1280 return true; |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1281 } |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1282 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1283 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1284 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1285 |
7363 | 1286 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1287 double m_current_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1288 finite_type m_finite_constraint; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1289 std::pair<double, bool> m_minval, m_maxval; |
7363 | 1290 }; |
1291 | |
1292 // --------------------------------------------------------------------- | |
1293 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1294 class OCTINTERP_API double_radio_property : public base_property |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1295 { |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1296 public: |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1297 double_radio_property (double d, const radio_values& v) |
17652
57750dc54ab6
maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents:
17646
diff
changeset
|
1298 : base_property ("", graphics_handle ()), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1299 m_current_type (double_t), m_dval (d), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1300 m_current_val (v.default_value ()) |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1301 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1302 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1303 double_radio_property (const std::string& nm, const graphics_handle& h, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
1304 const std::string& v) |
17652
57750dc54ab6
maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents:
17646
diff
changeset
|
1305 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1306 m_current_type (radio_t), m_dval (0), m_radio_val (v), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1307 m_current_val (m_radio_val.default_value ()) |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1308 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1309 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1310 double_radio_property (const std::string& nm, const graphics_handle& h, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
1311 const double_radio_property& v) |
17652
57750dc54ab6
maint: Correct indentation in graphics.cc, graphics.in.h. No code changes.
Rik <rik@octave.org>
parents:
17646
diff
changeset
|
1312 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1313 m_current_type (v.m_current_type), m_dval (v.m_dval), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1314 m_radio_val (v.m_radio_val), m_current_val (v.m_current_val) |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1315 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1316 |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1317 double_radio_property (const double_radio_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1318 : base_property (p), m_current_type (p.m_current_type), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1319 m_dval (p.m_dval), m_radio_val (p.m_radio_val), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1320 m_current_val (p.m_current_val) { } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1321 |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1322 octave_value get (void) const |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1323 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1324 if (m_current_type == double_t) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1325 return m_dval; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1326 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1327 return m_current_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1328 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1329 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1330 bool is_double (void) const { return (m_current_type == double_t); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1331 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1332 bool is_radio (void) const { return (m_current_type == radio_t); } |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1333 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1334 bool is (const std::string& v) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1335 { return (is_radio () && m_current_val == v); } |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1336 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1337 double double_value (void) const |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1338 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1339 if (m_current_type != double_t) |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1340 error ("%s: property has no double", get_name ().c_str ()); |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1341 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1342 return m_dval; |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1343 } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1344 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1345 const std::string& current_value (void) const |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1346 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1347 if (m_current_type != radio_t) |
26107
05dfcb24ef12
Supply missing arguments to variable length *printf functions (bug #55046).
Rik <rik@octave.org>
parents:
26055
diff
changeset
|
1348 error ("%s: property has no radio value", get_name ().c_str ()); |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1349 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1350 return m_current_val; |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1351 } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1352 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1353 double_radio_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1354 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1355 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1356 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1357 } |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1358 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1359 operator octave_value (void) const { return get (); } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1360 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1361 base_property * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1362 { return new double_radio_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1363 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1364 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1365 OCTINTERP_API bool do_set (const octave_value& v); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1366 |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1367 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1368 enum current_enum { double_t, radio_t } m_current_type; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1369 double m_dval; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1370 radio_values m_radio_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1371 std::string m_current_val; |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1372 }; |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1373 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1374 // --------------------------------------------------------------------- |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1375 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1376 class OCTINTERP_API array_property : public base_property |
7363 | 1377 { |
1378 public: | |
7836
4fb2db9c87dd
Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7835
diff
changeset
|
1379 array_property (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1380 : base_property ("", graphics_handle ()), m_data (Matrix ()), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1381 m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1382 m_type_constraints (), m_size_constraints (), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1383 m_finite_constraint (NO_CHECK), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1384 m_minval (std::pair<double, bool> (octave_NaN, true)), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1385 m_maxval (std::pair<double, bool> (octave_NaN, true)) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1386 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1387 get_data_limits (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1388 } |
7836
4fb2db9c87dd
Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7835
diff
changeset
|
1389 |
7364 | 1390 array_property (const std::string& nm, const graphics_handle& h, |
7363 | 1391 const octave_value& m) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1392 : base_property (nm, h), m_data (m.issparse () ? m.full_value () : m), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1393 m_min_val (), m_max_val (), m_min_pos (), m_max_neg (), |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1394 m_type_constraints (), m_size_constraints (), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1395 m_finite_constraint (NO_CHECK), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1396 m_minval (std::pair<double, bool> (octave_NaN, true)), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1397 m_maxval (std::pair<double, bool> (octave_NaN, true)) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1398 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1399 get_data_limits (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1400 } |
7363 | 1401 |
7848
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1402 // This copy constructor is only intended to be used |
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1403 // internally to access min/max values; no need to |
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1404 // copy constraints. |
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1405 array_property (const array_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1406 : base_property (p), m_data (p.m_data), |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1407 m_min_val (p.m_min_val), m_max_val (p.m_max_val), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1408 m_min_pos (p.m_min_pos), m_max_neg (p.m_max_neg), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1409 m_type_constraints (), m_size_constraints (), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
1410 m_finite_constraint (NO_CHECK), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1411 m_minval (std::pair<double, bool> (octave_NaN, true)), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1412 m_maxval (std::pair<double, bool> (octave_NaN, true)) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1413 { } |
7848
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1414 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1415 octave_value get (void) const { return m_data; } |
7363 | 1416 |
1417 void add_constraint (const std::string& type) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1418 { m_type_constraints.insert (type); } |
7363 | 1419 |
7524
a653856aa3e1
array_value::add_constraint: pass dim_vector as const reference, not value
John W. Eaton <jwe@octave.org>
parents:
7523
diff
changeset
|
1420 void add_constraint (const dim_vector& dims) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1421 { m_size_constraints.push_back (dims); } |
7363 | 1422 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1423 void add_constraint (const finite_type finite) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1424 { m_finite_constraint = finite; } |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1425 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1426 void add_constraint (const std::string& type, double val, bool inclusive) |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1427 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1428 if (type == "min") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1429 m_minval = std::pair<double, bool> (val, inclusive); |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1430 else if (type == "max") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1431 m_maxval = std::pair<double, bool> (val, inclusive); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1432 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1433 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1434 double min_val (void) const { return m_min_val; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1435 double max_val (void) const { return m_max_val; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1436 double min_pos (void) const { return m_min_pos; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1437 double max_neg (void) const { return m_max_neg; } |
7836
4fb2db9c87dd
Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7835
diff
changeset
|
1438 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
1439 Matrix get_limits (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1440 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1441 Matrix m (1, 4); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1442 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1443 m(0) = min_val (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1444 m(1) = max_val (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1445 m(2) = min_pos (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1446 m(3) = max_neg (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1447 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1448 return m; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1449 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
1450 |
7363 | 1451 array_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1452 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1453 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1454 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1455 } |
7363 | 1456 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1457 base_property * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1458 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1459 array_property *p = new array_property (*this); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1460 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1461 p->m_type_constraints = m_type_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1462 p->m_size_constraints = m_size_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1463 p->m_finite_constraint = m_finite_constraint; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1464 p->m_minval = m_minval; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1465 p->m_maxval = m_maxval; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1466 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1467 return p; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1468 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1469 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1470 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1471 bool do_set (const octave_value& v) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1472 { |
23583
b7747a2c88b2
maint: Deprecate is_sparse_type and replace with issparse.
Rik <rik@octave.org>
parents:
23582
diff
changeset
|
1473 octave_value tmp = (v.issparse () ? v.full_value () : v); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1474 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1475 if (! validate (tmp)) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1476 error (R"(invalid value for array property "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1477 get_name ().c_str ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1478 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1479 // FIXME: should we check for actual data change? |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1480 if (! is_equal (tmp)) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1481 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1482 m_data = tmp; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1483 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1484 get_data_limits (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1485 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1486 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1487 } |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1488 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1489 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1490 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1491 |
7363 | 1492 private: |
1493 OCTINTERP_API bool validate (const octave_value& v); | |
1494 | |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1495 OCTINTERP_API bool is_equal (const octave_value& v) const; |
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1496 |
7836
4fb2db9c87dd
Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7835
diff
changeset
|
1497 OCTINTERP_API void get_data_limits (void); |
4fb2db9c87dd
Turn cdata properties into array_property. Add min/max computation to array_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7835
diff
changeset
|
1498 |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1499 protected: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1500 octave_value m_data; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1501 double m_min_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1502 double m_max_val; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1503 double m_min_pos; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1504 double m_max_neg; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1505 std::set<std::string> m_type_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1506 std::list<dim_vector> m_size_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1507 finite_type m_finite_constraint; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1508 std::pair<double, bool> m_minval, m_maxval; |
7363 | 1509 }; |
1510 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1511 class OCTINTERP_API row_vector_property : public array_property |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1512 { |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1513 public: |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1514 row_vector_property (const std::string& nm, const graphics_handle& h, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
1515 const octave_value& m) |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1516 : array_property (nm, h, m) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1517 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1518 add_constraint (dim_vector (-1, 1)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1519 add_constraint (dim_vector (1, -1)); |
17631
94dd9bba06a0
Fix validation of array properties to set(), avoid segfaults (bug #bug #35687).
Rik <rik@octave.org>
parents:
17625
diff
changeset
|
1520 add_constraint (dim_vector (0, 0)); |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1521 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1522 |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1523 row_vector_property (const row_vector_property& p) |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1524 : array_property (p) |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1525 { |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1526 add_constraint (dim_vector (-1, 1)); |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1527 add_constraint (dim_vector (1, -1)); |
17631
94dd9bba06a0
Fix validation of array properties to set(), avoid segfaults (bug #bug #35687).
Rik <rik@octave.org>
parents:
17625
diff
changeset
|
1528 add_constraint (dim_vector (0, 0)); |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1529 } |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1530 |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1531 void add_constraint (const std::string& type) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1532 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1533 array_property::add_constraint (type); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1534 } |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1535 |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1536 void add_constraint (const dim_vector& dims) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1537 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1538 array_property::add_constraint (dims); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1539 } |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1540 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1541 void add_constraint (const finite_type finite) |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1542 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1543 array_property::add_constraint (finite); |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1544 } |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1545 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1546 void add_constraint (const std::string& type, double val, bool inclusive) |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1547 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1548 array_property::add_constraint (type, val, inclusive); |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1549 } |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1550 |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1551 void add_constraint (octave_idx_type len) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1552 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1553 m_size_constraints.remove (dim_vector (1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1554 m_size_constraints.remove (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1555 m_size_constraints.remove (dim_vector (0, 0)); |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1556 |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1557 add_constraint (dim_vector (1, len)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1558 add_constraint (dim_vector (len, 1)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1559 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1560 |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1561 row_vector_property& operator = (const octave_value& val) |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1562 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1563 set (val); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1564 return *this; |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1565 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1566 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1567 base_property * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1568 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1569 row_vector_property *p = new row_vector_property (*this); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1570 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1571 p->m_type_constraints = m_type_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1572 p->m_size_constraints = m_size_constraints; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1573 p->m_finite_constraint = m_finite_constraint; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1574 p->m_minval = m_minval; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1575 p->m_maxval = m_maxval; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1576 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1577 return p; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1578 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1579 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1580 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1581 bool do_set (const octave_value& v) |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1582 { |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1583 bool retval = array_property::do_set (v); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1584 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1585 dim_vector dv = m_data.dims (); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1586 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1587 if (dv(0) > 1 && dv(1) == 1) |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1588 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1589 int tmp = dv(0); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1590 dv(0) = dv(1); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1591 dv(1) = tmp; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1592 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1593 m_data = m_data.reshape (dv); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1594 } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1595 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1596 return retval; |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1597 } |
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1598 |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1599 private: |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1600 OCTINTERP_API bool validate (const octave_value& v); |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1601 }; |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1602 |
7363 | 1603 // --------------------------------------------------------------------- |
1604 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1605 class OCTINTERP_API bool_property : public radio_property |
7363 | 1606 { |
1607 public: | |
7364 | 1608 bool_property (const std::string& nm, const graphics_handle& h, |
7363 | 1609 bool val) |
7364 | 1610 : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1611 { } |
7363 | 1612 |
7364 | 1613 bool_property (const std::string& nm, const graphics_handle& h, |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1614 const char *val) |
24687
8b935067a257
Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24637
diff
changeset
|
1615 : radio_property (nm, h, radio_values (std::string (val) == "on" ? |
24635
b708857d634e
Correctly display boolean properties default values (bug #52768)
Sahil Yadav <yadavsahil5198@gmail.com>
parents:
24534
diff
changeset
|
1616 "{on}|off" : "on|{off}"), val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1617 { } |
7363 | 1618 |
1619 bool_property (const bool_property& p) | |
1620 : radio_property (p) { } | |
1621 | |
1622 bool is_on (void) const { return is ("on"); } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1623 |
7363 | 1624 bool_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1625 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1626 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1627 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1628 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1629 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1630 base_property * clone (void) const { return new bool_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1631 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1632 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1633 bool do_set (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1634 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1635 if (val.is_bool_scalar ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1636 return radio_property::do_set (val.bool_value () ? "on" : "off"); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1637 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1638 return radio_property::do_set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1639 } |
7363 | 1640 }; |
1641 | |
1642 // --------------------------------------------------------------------- | |
1643 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1644 class OCTINTERP_API handle_property : public base_property |
7363 | 1645 { |
1646 public: | |
7364 | 1647 handle_property (const std::string& nm, const graphics_handle& h, |
7363 | 1648 const graphics_handle& val = graphics_handle ()) |
7364 | 1649 : base_property (nm, h), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1650 m_current_val (val) { } |
7363 | 1651 |
1652 handle_property (const handle_property& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1653 : base_property (p), m_current_val (p.m_current_val) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1654 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1655 octave_value get (void) const { return m_current_val.as_octave_value (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1656 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1657 graphics_handle handle_value (void) const { return m_current_val; } |
7363 | 1658 |
1659 handle_property& operator = (const octave_value& val) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1660 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1661 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1662 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1663 } |
7363 | 1664 |
1665 handle_property& operator = (const graphics_handle& h) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1666 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1667 set (octave_value (h.value ())); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1668 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1669 } |
7363 | 1670 |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
1671 void invalidate (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1672 { m_current_val = octave::numeric_limits<double>::NaN (); } |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
1673 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1674 base_property * clone (void) const { return new handle_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1675 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1676 void add_constraint (const std::string& type) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1677 { m_type_constraints.insert (type); } |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1678 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1679 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1680 OCTINTERP_API bool do_set (const octave_value& v); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1681 std::set<std::string> m_type_constraints; |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1682 |
7363 | 1683 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1684 graphics_handle m_current_val; |
7363 | 1685 }; |
1686 | |
1687 // --------------------------------------------------------------------- | |
1688 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1689 class OCTINTERP_API any_property : public base_property |
7363 | 1690 { |
1691 public: | |
7364 | 1692 any_property (const std::string& nm, const graphics_handle& h, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1693 const octave_value& m = Matrix ()) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1694 : base_property (nm, h), m_data (m) { } |
7363 | 1695 |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1696 any_property (const any_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1697 : base_property (p), m_data (p.m_data) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1698 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1699 octave_value get (void) const { return m_data; } |
7363 | 1700 |
1701 any_property& operator = (const octave_value& val) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1702 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1703 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1704 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1705 } |
7363 | 1706 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1707 base_property * clone (void) const { return new any_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1708 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1709 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1710 bool do_set (const octave_value& v) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1711 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1712 m_data = v; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1713 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1714 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1715 |
7363 | 1716 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1717 octave_value m_data; |
7363 | 1718 }; |
1719 | |
1720 // --------------------------------------------------------------------- | |
1721 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1722 class OCTINTERP_API children_property : public base_property |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1723 { |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1724 public: |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1725 children_property (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1726 : base_property ("", graphics_handle ()), m_children_list () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1727 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1728 do_init_children (Matrix ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1729 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1730 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1731 children_property (const std::string& nm, const graphics_handle& h, |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1732 const Matrix& val) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1733 : base_property (nm, h), m_children_list () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1734 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1735 do_init_children (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1736 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1737 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1738 children_property (const children_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1739 : base_property (p), m_children_list () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1740 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1741 do_init_children (p.m_children_list); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1742 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1743 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1744 children_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1745 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1746 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1747 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1748 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1749 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1750 base_property * clone (void) const { return new children_property (*this); } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1751 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1752 bool remove_child (double val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1753 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1754 return do_remove_child (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1755 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1756 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1757 void adopt (double val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1758 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1759 do_adopt_child (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1760 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1761 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1762 Matrix get_children (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1763 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1764 return do_get_children (false); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1765 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1766 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1767 Matrix get_hidden (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1768 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1769 return do_get_children (true); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1770 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1771 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1772 Matrix get_all (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1773 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1774 return do_get_all_children (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1775 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1776 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1777 octave_value get (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1778 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1779 return octave_value (get_children ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1780 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1781 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
1782 void delete_children (bool clear = false, bool from_root = false) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1783 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1784 do_delete_children (clear, from_root); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1785 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1786 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
1787 void renumber (graphics_handle old_gh, graphics_handle new_gh) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1788 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1789 for (auto& hchild : m_children_list) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1790 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1791 if (hchild == old_gh) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1792 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1793 hchild = new_gh.value (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1794 return; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1795 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1796 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1797 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1798 error ("children_list::renumber: child not found!"); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1799 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
1800 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1801 private: |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1802 typedef std::list<double>::iterator children_list_iterator; |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1803 typedef std::list<double>::const_iterator const_children_list_iterator; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1804 std::list<double> m_children_list; |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1805 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1806 protected: |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1807 bool do_set (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1808 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1809 Matrix new_kids; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1810 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1811 try |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1812 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1813 new_kids = val.matrix_value (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1814 } |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
1815 catch (octave::execution_exception& ee) |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1816 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
1817 error (ee, "set: children must be an array of graphics handles"); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1818 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1819 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1820 octave_idx_type nel = new_kids.numel (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1821 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1822 const Matrix new_kids_column = new_kids.reshape (dim_vector (nel, 1)); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1823 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1824 bool is_ok = true; |
19678
c17e1cefdbd3
Fix reordering graphics property children for hidden objects (bug #44211)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19666
diff
changeset
|
1825 bool add_hidden = true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1826 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1827 const Matrix visible_kids = do_get_children (false); |
31241
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1828 const Matrix hidden_kids = do_get_children (true); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1829 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1830 if (visible_kids.numel () == new_kids.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1831 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1832 Matrix t1 = visible_kids.sort (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1833 Matrix t2 = new_kids_column.sort (); |
31241
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1834 Matrix t3 = hidden_kids.sort (); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1835 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1836 if (t1 != t2) |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1837 is_ok = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1838 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1839 if (t1 == t3) |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1840 add_hidden = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1841 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1842 else |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1843 is_ok = false; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1844 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1845 if (! is_ok) |
31241
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1846 error ("set: new children list must be a permutation of existing " |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1847 "children with visible handles"); |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1848 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1849 m_children_list.clear (); |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1850 |
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1851 // Don't use do_init_children here, as that reverses the |
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1852 // order of the list, and we don't want to do that if setting |
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1853 // the child list directly. |
31241
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1854 for (octave_idx_type i = 0; i < new_kids_column.numel (); i++) |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1855 m_children_list.push_back (new_kids_column.xelem (i)); |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1856 |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1857 if (add_hidden) |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1858 for (octave_idx_type i = 0; i < hidden_kids.numel (); i++) |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1859 m_children_list.push_back (hidden_kids.xelem (i)); |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1860 |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1861 return true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1862 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1863 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1864 private: |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1865 void do_init_children (const Matrix& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1866 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1867 m_children_list.clear (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1868 for (octave_idx_type i = 0; i < val.numel (); i++) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1869 m_children_list.push_front (val.xelem (i)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1870 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1871 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1872 void do_init_children (const std::list<double>& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1873 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1874 m_children_list.clear (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1875 m_children_list = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1876 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1877 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1878 OCTINTERP_API Matrix do_get_children (bool return_hidden) const; |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1879 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1880 Matrix do_get_all_children (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1881 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1882 Matrix retval (m_children_list.size (), 1); |
21568
3d60ed163b70
maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents:
21562
diff
changeset
|
1883 octave_idx_type i = 0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1884 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1885 for (const auto& hchild : m_children_list) |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1886 retval(i++) = hchild; |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1887 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1888 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1889 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1890 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1891 bool do_remove_child (double child) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1892 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1893 for (auto it = m_children_list.begin (); it != m_children_list.end (); it++) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1894 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1895 if (*it == child) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1896 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1897 m_children_list.erase (it); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1898 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1899 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1900 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1901 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1902 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1903 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1904 void do_adopt_child (double val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1905 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1906 m_children_list.push_front (val); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1907 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1908 |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1909 void do_delete_children (bool clear, bool from_root); |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1910 }; |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1911 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1912 // --------------------------------------------------------------------- |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1913 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1914 class OCTINTERP_API callback_property : public base_property |
7363 | 1915 { |
1916 public: | |
7364 | 1917 callback_property (const std::string& nm, const graphics_handle& h, |
7363 | 1918 const octave_value& m) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1919 : base_property (nm, h), m_callback (m) { } |
7363 | 1920 |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1921 callback_property (const callback_property& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1922 : base_property (p), m_callback (p.m_callback) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1923 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1924 octave_value get (void) const { return m_callback; } |
7363 | 1925 |
7367 | 1926 OCTINTERP_API void execute (const octave_value& data = octave_value ()) const; |
7363 | 1927 |
10517 | 1928 bool is_defined (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1929 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1930 return (m_callback.is_defined () && ! m_callback.isempty ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1931 } |
10517 | 1932 |
7363 | 1933 callback_property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1934 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1935 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1936 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1937 } |
7363 | 1938 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
1939 base_property * clone (void) const { return new callback_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1940 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1941 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1942 bool do_set (const octave_value& v) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1943 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1944 if (! validate (v)) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1945 error (R"(invalid value for callback property "%s")", |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1946 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1947 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1948 m_callback = v; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1949 return true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1950 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1951 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1952 |
7363 | 1953 private: |
1954 OCTINTERP_API bool validate (const octave_value& v) const; | |
1955 | |
1956 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1957 octave_value m_callback; |
7363 | 1958 }; |
1959 | |
1960 // --------------------------------------------------------------------- | |
1961 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1962 class OCTINTERP_API property |
7363 | 1963 { |
1964 public: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1965 property (void) : m_rep (new base_property ("", graphics_handle ())) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1966 { } |
7363 | 1967 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1968 property (base_property *bp, bool persist = false) : m_rep (bp) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1969 { if (persist) m_rep->m_count++; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1970 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1971 property (const property& p) : m_rep (p.m_rep) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1972 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1973 m_rep->m_count++; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1974 } |
7363 | 1975 |
1976 ~property (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1977 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1978 if (--m_rep->m_count == 0) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1979 delete m_rep; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1980 } |
7363 | 1981 |
1982 bool ok (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1983 { return m_rep->ok (); } |
7363 | 1984 |
1985 std::string get_name (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1986 { return m_rep->get_name (); } |
7363 | 1987 |
1988 void set_name (const std::string& name) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1989 { m_rep->set_name (name); } |
7363 | 1990 |
1991 graphics_handle get_parent (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1992 { return m_rep->get_parent (); } |
7363 | 1993 |
1994 void set_parent (const graphics_handle& h) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1995 { m_rep->set_parent (h); } |
7363 | 1996 |
1997 bool is_hidden (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1998 { return m_rep->is_hidden (); } |
7363 | 1999 |
2000 void set_hidden (bool flag) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2001 { m_rep->set_hidden (flag); } |
7363 | 2002 |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2003 bool is_radio (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2004 { return m_rep->is_radio (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2005 |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2006 int get_id (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2007 { return m_rep->get_id (); } |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2008 |
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2009 void set_id (int d) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2010 { m_rep->set_id (d); } |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2011 |
7363 | 2012 octave_value get (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2013 { return m_rep->get (); } |
7363 | 2014 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2015 bool set (const octave_value& val, bool do_run = true, |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2016 bool do_notify_toolkit = true) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2017 { return m_rep->set (val, do_run, do_notify_toolkit); } |
7363 | 2018 |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2019 std::string values_as_string (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2020 { return m_rep->values_as_string (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2021 |
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2022 Cell values_as_cell (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2023 { return m_rep->values_as_cell (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2024 |
7363 | 2025 property& operator = (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2026 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2027 *m_rep = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2028 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2029 } |
7363 | 2030 |
2031 property& operator = (const property& p) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2032 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2033 if (m_rep && --m_rep->m_count == 0) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2034 delete m_rep; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2035 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2036 m_rep = p.m_rep; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2037 m_rep->m_count++; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2038 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2039 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2040 } |
7363 | 2041 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2042 void add_listener (const octave_value& v, listener_mode mode = GCB_POSTSET) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2043 { m_rep->add_listener (v, mode); } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2044 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2045 void delete_listener (const octave_value& v = octave_value (), |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2046 listener_mode mode = GCB_POSTSET) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2047 { m_rep->delete_listener (v, mode); } |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2048 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2049 void run_listeners (listener_mode mode = GCB_POSTSET) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2050 { m_rep->run_listeners (mode); } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2051 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2052 static OCTINTERP_API property |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2053 create (const std::string& name, const graphics_handle& parent, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2054 const caseless_str& type, const octave_value_list& args); |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2055 |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2056 property clone (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2057 { return property (m_rep->clone ()); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2058 |
20946 | 2059 #if 0 |
7363 | 2060 const string_property& as_string_property (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2061 { return *(dynamic_cast<string_property *> (m_rep)); } |
7363 | 2062 |
2063 const radio_property& as_radio_property (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2064 { return *(dynamic_cast<radio_property *> (m_rep)); } |
7363 | 2065 |
2066 const color_property& as_color_property (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2067 { return *(dynamic_cast<color_property *> (m_rep)); } |
7363 | 2068 |
2069 const double_property& as_double_property (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2070 { return *(dynamic_cast<double_property *> (m_rep)); } |
7363 | 2071 |
2072 const bool_property& as_bool_property (void) const | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2073 { return *(dynamic_cast<bool_property *> (m_rep)); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2074 |
7363 | 2075 const handle_property& as_handle_property (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2076 { return *(dynamic_cast<handle_property *> (m_rep)); } |
20946 | 2077 #endif |
7363 | 2078 |
2079 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2080 base_property *m_rep; |
7363 | 2081 }; |
2082 | |
2083 // --------------------------------------------------------------------- | |
2084 | |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
2085 typedef std::pair<std::string, octave_value> pval_pair; |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
2086 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2087 class OCTINTERP_API pval_vector : public std::vector<pval_pair> |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2088 { |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2089 public: |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2090 const_iterator find (const std::string pname) const |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2091 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2092 const_iterator it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2093 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2094 for (it = (*this).begin (); it != (*this).end (); it++) |
21021
a5b99b09f8fd
maint: Use comparison operators rather than compare() for strings.
Rik <rik@octave.org>
parents:
21017
diff
changeset
|
2095 if (pname == (*it).first) |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2096 return it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2097 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2098 return (*this).end (); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2099 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2100 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2101 iterator find (const std::string pname) |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2102 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2103 iterator it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2104 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2105 for (it = (*this).begin (); it != (*this).end (); it++) |
21021
a5b99b09f8fd
maint: Use comparison operators rather than compare() for strings.
Rik <rik@octave.org>
parents:
21017
diff
changeset
|
2106 if (pname == (*it).first) |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2107 return it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2108 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2109 return (*this).end (); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2110 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2111 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2112 octave_value lookup (const std::string pname) const |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2113 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2114 octave_value retval; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2115 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2116 const_iterator it = find (pname); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2117 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2118 if (it != (*this).end ()) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2119 retval = (*it).second; |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2120 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2121 return retval; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2122 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2123 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2124 octave_value& operator [] (const std::string pname) |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2125 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2126 iterator it = find (pname); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2127 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2128 if (it == (*this).end ()) |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2129 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2130 push_back (pval_pair (pname, octave_value ())); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2131 return (*this).back ().second; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2132 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2133 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2134 return (*it).second; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2135 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2136 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2137 void erase (const std::string pname) |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2138 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2139 iterator it = find (pname); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2140 if (it != (*this).end ()) |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2141 erase (it); |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2142 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2143 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2144 void erase (iterator it) |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2145 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
2146 std::vector<pval_pair>::erase (it); |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2147 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2148 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2149 }; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2150 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2151 class OCTINTERP_API property_list |
7363 | 2152 { |
2153 public: | |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2154 typedef pval_vector pval_map_type; |
7363 | 2155 typedef std::map<std::string, pval_map_type> plist_map_type; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2156 |
7363 | 2157 typedef pval_map_type::iterator pval_map_iterator; |
2158 typedef pval_map_type::const_iterator pval_map_const_iterator; | |
2159 | |
2160 typedef plist_map_type::iterator plist_map_iterator; | |
2161 typedef plist_map_type::const_iterator plist_map_const_iterator; | |
2162 | |
2163 property_list (const plist_map_type& m = plist_map_type ()) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2164 : m_plist_map (m) { } |
7363 | 2165 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
2166 ~property_list (void) = default; |
7363 | 2167 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2168 OCTINTERP_API void set (const caseless_str& name, const octave_value& val); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2169 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2170 OCTINTERP_API octave_value lookup (const caseless_str& name) const; |
7363 | 2171 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2172 plist_map_iterator begin (void) { return m_plist_map.begin (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2173 plist_map_const_iterator begin (void) const { return m_plist_map.begin (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2174 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2175 plist_map_iterator end (void) { return m_plist_map.end (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2176 plist_map_const_iterator end (void) const { return m_plist_map.end (); } |
7363 | 2177 |
2178 plist_map_iterator find (const std::string& go_name) | |
2179 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2180 return m_plist_map.find (go_name); |
7363 | 2181 } |
2182 | |
2183 plist_map_const_iterator find (const std::string& go_name) const | |
2184 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2185 return m_plist_map.find (go_name); |
7363 | 2186 } |
2187 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2188 OCTINTERP_API octave_scalar_map |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2189 as_struct (const std::string& prefix_arg) const; |
7363 | 2190 |
2191 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2192 plist_map_type m_plist_map; |
7363 | 2193 }; |
2194 | |
2195 // --------------------------------------------------------------------- | |
2196 | |
6874 | 2197 class base_graphics_object; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2198 class graphics_object; |
6874 | 2199 |
7365 | 2200 class OCTINTERP_API base_properties |
6874 | 2201 { |
2202 public: | |
7176 | 2203 base_properties (const std::string& ty = "unknown", |
7363 | 2204 const graphics_handle& mh = graphics_handle (), |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2205 const graphics_handle& p = graphics_handle ()); |
6874 | 2206 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
2207 virtual ~base_properties (void) = default; |
6874 | 2208 |
17625
bd1dd30ed202
graphics.in.h: Correct bad spelling of "unknown" in graphics_object_name().
Rik <rik@octave.org>
parents:
17544
diff
changeset
|
2209 virtual std::string graphics_object_name (void) const { return "unknown"; } |
6874 | 2210 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2211 OCTINTERP_API void mark_modified (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2212 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2213 OCTINTERP_API void override_defaults (base_graphics_object& obj); |
6874 | 2214 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2215 virtual void init_integerhandle (const octave_value&) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2216 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2217 panic_impossible (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2218 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2219 |
6874 | 2220 // Look through DEFAULTS for properties with given CLASS_NAME, and |
2221 // apply them to the current object with set (virtual method). | |
2222 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2223 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2224 set_from_list (base_graphics_object& obj, property_list& defaults); |
6874 | 2225 |
7363 | 2226 void insert_property (const std::string& name, property p) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2227 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2228 p.set_name (name); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2229 p.set_parent (m___myhandle__); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2230 m_all_props[name] = p; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2231 } |
7363 | 2232 |
9972 | 2233 virtual void set (const caseless_str&, const octave_value&); |
9185
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2234 |
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2235 virtual octave_value get (const caseless_str& pname) const; |
7363 | 2236 |
9616
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2237 virtual octave_value get (const std::string& pname) const |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2238 { |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2239 return get (caseless_str (pname)); |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2240 } |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2241 |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2242 virtual octave_value get (const char *pname) const |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2243 { |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2244 return get (caseless_str (pname)); |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2245 } |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2246 |
7379 | 2247 virtual octave_value get (bool all = false) const; |
7363 | 2248 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2249 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2250 // currently not possible with the way that properties are stored as |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2251 // specific types in the graphics_object classes. |
9185
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2252 virtual property get_property (const caseless_str& pname); |
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2253 |
9585
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2254 virtual bool has_property (const caseless_str&) const |
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2255 { |
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2256 panic_impossible (); |
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2257 return false; |
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2258 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2259 |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2260 bool is_modified (void) const { return is___modified__ (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2261 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2262 virtual void remove_child (const graphics_handle& h, bool = false) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2263 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2264 if (m_children.remove_child (h.value ())) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2265 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2266 m_children.run_listeners (); |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2267 mark_modified (); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2268 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2269 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2270 |
7386 | 2271 virtual void adopt (const graphics_handle& h) |
6874 | 2272 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2273 m_children.adopt (h.value ()); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2274 m_children.run_listeners (); |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
2275 mark_modified (); |
6874 | 2276 } |
2277 | |
27734
a9780be9ecbc
move graphics_toolkit class inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27730
diff
changeset
|
2278 virtual octave::graphics_toolkit get_toolkit (void) const; |
7419 | 2279 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2280 virtual Matrix |
20946 | 2281 get_boundingbox (bool /* finternal */ = false, |
2282 const Matrix& /* parent_pix_size */ = Matrix ()) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2283 { return Matrix (1, 4, 0.0); } |
7447 | 2284 |
7828
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
2285 virtual void update_boundingbox (void); |
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
2286 |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
2287 virtual void update_autopos (const std::string& elem_type); |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
2288 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2289 virtual void add_listener (const caseless_str&, const octave_value&, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2290 listener_mode = GCB_POSTSET); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2291 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2292 virtual void delete_listener (const caseless_str&, const octave_value&, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2293 listener_mode = GCB_POSTSET); |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2294 |
27698
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2295 void set_beingdeleted (const octave_value& val) |
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2296 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2297 m_beingdeleted.set (val, true, false); |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
2298 update_beingdeleted (); |
27698
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2299 } |
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2300 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2301 void set_tag (const octave_value& val) { m_tag = val; } |
7176 | 2302 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2303 OCTINTERP_API void set_parent (const octave_value& val); |
6874 | 2304 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2305 Matrix get_children (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2306 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2307 return m_children.get_children (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2308 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2309 |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2310 Matrix get_all_children (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2311 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2312 return m_children.get_all (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2313 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2314 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2315 Matrix get_hidden_children (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2316 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2317 return m_children.get_hidden (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2318 } |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2319 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2320 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2321 get_children_of_type (const caseless_str& type, bool get_invisible, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2322 bool traverse, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2323 std::list<graphics_object> &children_list) const; |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
2324 |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2325 void set_modified (const octave_value& val) { set___modified__ (val); } |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2326 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2327 void set___modified__ (const octave_value& val) { m___modified__ = val; } |
7366 | 2328 |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2329 // Redirect calls to "uicontextmenu" to "contextmenu". |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2330 |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2331 graphics_handle get_uicontextmenu (void) const |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2332 { |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2333 return get_contextmenu (); |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2334 } |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2335 |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2336 void set_uicontextmenu (const octave_value& val) |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2337 { |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2338 set_contextmenu (val); |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2339 } |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2340 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2341 void reparent (const graphics_handle& new_parent) { m_parent = new_parent; } |
6874 | 2342 |
7214 | 2343 // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent |
2344 // axes object. | |
2345 | |
7386 | 2346 virtual void update_axis_limits (const std::string& axis_type) const; |
7214 | 2347 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2348 virtual void update_axis_limits (const std::string& axis_type, |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2349 const graphics_handle& h) const; |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2350 |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2351 virtual void update_contextmenu (void) const; |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
2352 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2353 virtual void delete_children (bool clear = false, bool from_root = false) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2354 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2355 m_children.delete_children (clear, from_root); |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2356 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2357 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2358 void renumber_child (graphics_handle old_gh, graphics_handle new_gh) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2359 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2360 m_children.renumber (old_gh, new_gh); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2361 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2362 |
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2363 void renumber_parent (graphics_handle new_gh) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2364 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2365 m_parent = new_gh; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2366 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2367 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2368 static OCTINTERP_API property_list::pval_map_type factory_defaults (void); |
7222 | 2369 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
2370 // FIXME: These functions should be generated automatically by the |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2371 // genprops.awk script. |
7222 | 2372 // |
2373 // EMIT_BASE_PROPERTIES_GET_FUNCTIONS | |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2374 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2375 virtual octave_value get_alim (void) const { return octave_value (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2376 virtual octave_value get_clim (void) const { return octave_value (); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2377 virtual octave_value get_xlim (void) const { return octave_value (); } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2378 virtual octave_value get_ylim (void) const { return octave_value (); } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2379 virtual octave_value get_zlim (void) const { return octave_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2380 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2381 virtual bool is_aliminclude (void) const { return false; } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2382 virtual bool is_climinclude (void) const { return false; } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2383 virtual bool is_xliminclude (void) const { return false; } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2384 virtual bool is_yliminclude (void) const { return false; } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2385 virtual bool is_zliminclude (void) const { return false; } |
8249 | 2386 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2387 OCTINTERP_API bool is_handle_visible (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2388 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2389 OCTINTERP_API std::set<std::string> dynamic_property_names (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2390 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2391 OCTINTERP_API bool has_dynamic_property (const std::string& pname) const; |
9185
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2392 |
6874 | 2393 protected: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2394 std::set<std::string> m_dynamic_properties; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2395 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2396 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2397 set_dynamic (const caseless_str& pname, const octave_value& val); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2398 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2399 OCTINTERP_API octave_value get_dynamic (const caseless_str& pname) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2400 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2401 OCTINTERP_API octave_value get_dynamic (bool all = false) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2402 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2403 OCTINTERP_API property get_property_dynamic (const caseless_str& pname) const; |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2404 |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2405 BEGIN_BASE_PROPERTIES |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2406 // properties common to all objects |
27698
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2407 bool_property beingdeleted s , "off" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2408 radio_property busyaction , "{queue}|cancel" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2409 callback_property buttondownfcn , Matrix () |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2410 children_property children gf , Matrix () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2411 bool_property clipping , "on" |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2412 handle_property contextmenu u , graphics_handle () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2413 callback_property createfcn , Matrix () |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2414 callback_property deletefcn , Matrix () |
24395
41cf6ee90cb6
Better handling of "handlevisibility" property (bug #52621).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24277
diff
changeset
|
2415 radio_property handlevisibility u , "{on}|callback|off" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2416 bool_property hittest , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2417 bool_property interruptible , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2418 handle_property parent fs , p |
24523
501986e12b8b
Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24501
diff
changeset
|
2419 radio_property pickableparts , "{visible}|all|none" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2420 bool_property selected , "off" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2421 bool_property selectionhighlight , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2422 string_property tag s , "" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2423 string_property type frs , ty |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2424 handle_property uicontextmenu gsh , graphics_handle () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2425 any_property userdata , Matrix () |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
2426 bool_property visible u , "on" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2427 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2428 // Octave-specific properties |
27682
e18237114cf8
Hide __appdata__ internal property (bug #57211).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
27446
diff
changeset
|
2429 any_property __appdata__ h , Matrix () |
22665
4ea5b0c3b10f
Make base graphics property __modified__ hidden (bug #49205).
Rik <rik@octave.org>
parents:
22631
diff
changeset
|
2430 bool_property __modified__ hs , "on" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2431 graphics_handle __myhandle__ fhrs , mh |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2432 END_PROPERTIES |
7363 | 2433 |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
2434 virtual void update_beingdeleted (void) { }; |
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
2435 |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
2436 virtual void update_handlevisibility (void); |
24395
41cf6ee90cb6
Better handling of "handlevisibility" property (bug #52621).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24277
diff
changeset
|
2437 |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
2438 virtual void update_visible (void) { }; |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
2439 |
7363 | 2440 protected: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2441 struct cmp_caseless_str |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2442 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
30053
diff
changeset
|
2443 public: |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
2444 bool operator () (const caseless_str& a, const caseless_str& b) const |
8052
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8023
diff
changeset
|
2445 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2446 std::string a1 = a; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2447 std::transform (a1.begin (), a1.end (), a1.begin (), tolower); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2448 std::string b1 = b; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2449 std::transform (b1.begin (), b1.end (), b1.begin (), tolower); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2450 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2451 return a1 < b1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2452 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2453 }; |
8052
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8023
diff
changeset
|
2454 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2455 std::map<caseless_str, property, cmp_caseless_str> m_all_props; |
7363 | 2456 |
2457 protected: | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2458 |
22910
23847979b91e
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
2459 virtual void init (void) |
23847979b91e
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
2460 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2461 m_contextmenu.add_constraint ("uicontextmenu"); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
2462 } |
6874 | 2463 }; |
2464 | |
7365 | 2465 class OCTINTERP_API base_graphics_object |
6874 | 2466 { |
2467 public: | |
2468 friend class graphics_object; | |
2469 | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2470 base_graphics_object (void) : m_toolkit_flag (false) { } |
6874 | 2471 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2472 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2473 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2474 base_graphics_object (const base_graphics_object&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2475 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2476 base_graphics_object& operator = (const base_graphics_object&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2477 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
2478 virtual ~base_graphics_object (void) = default; |
6874 | 2479 |
2480 virtual void mark_modified (void) | |
2481 { | |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2482 if (! valid_object ()) |
7386 | 2483 error ("base_graphics_object::mark_modified: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2484 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2485 get_properties ().mark_modified (); |
6874 | 2486 } |
2487 | |
7386 | 2488 virtual void override_defaults (base_graphics_object& obj) |
6874 | 2489 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2490 if (! valid_object ()) |
7386 | 2491 error ("base_graphics_object::override_defaults: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2492 get_properties ().override_defaults (obj); |
6874 | 2493 } |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2494 |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23401
diff
changeset
|
2495 void build_user_defaults_map (property_list::pval_map_type& def, |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2496 const std::string go_name) const; |
6874 | 2497 |
7386 | 2498 virtual void set_from_list (property_list& plist) |
6874 | 2499 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2500 if (! valid_object ()) |
7386 | 2501 error ("base_graphics_object::set_from_list: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2502 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2503 get_properties ().set_from_list (*this, plist); |
6874 | 2504 } |
2505 | |
7386 | 2506 virtual void set (const caseless_str& pname, const octave_value& pval) |
6874 | 2507 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2508 if (! valid_object ()) |
7386 | 2509 error ("base_graphics_object::set: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2510 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2511 get_properties ().set (pname, pval); |
6874 | 2512 } |
2513 | |
2514 virtual void set_defaults (const std::string&) | |
2515 { | |
2516 error ("base_graphics_object::set_defaults: invalid graphics object"); | |
2517 } | |
2518 | |
26918
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2519 // The following version of the get method is not declared virtual |
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2520 // because no derived class overrides it. |
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2521 |
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2522 octave_value get (bool all = false) const |
6874 | 2523 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2524 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2525 error ("base_graphics_object::get: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2526 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2527 return get_properties ().get (all); |
6874 | 2528 } |
2529 | |
7386 | 2530 virtual octave_value get (const caseless_str& pname) const |
6874 | 2531 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2532 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2533 error ("base_graphics_object::get: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2534 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2535 return get_properties ().get (pname); |
6874 | 2536 } |
2537 | |
7189 | 2538 virtual octave_value get_default (const caseless_str&) const; |
6874 | 2539 |
7189 | 2540 virtual octave_value get_factory_default (const caseless_str&) const; |
6874 | 2541 |
2542 virtual octave_value get_defaults (void) const | |
2543 { | |
2544 error ("base_graphics_object::get_defaults: invalid graphics object"); | |
2545 } | |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2546 |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2547 virtual property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2548 { |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2549 if (! valid_object ()) |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2550 error ("base_graphics_object::get_defaults_list: invalid graphics object"); |
21055
5e00ed38a58b
maint: Replace if/error/else paradigm with just if/error.
Rik <rik@octave.org>
parents:
21021
diff
changeset
|
2551 |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2552 return property_list (); |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2553 } |
6874 | 2554 |
2555 virtual octave_value get_factory_defaults (void) const | |
2556 { | |
2557 error ("base_graphics_object::get_factory_defaults: invalid graphics object"); | |
2558 } | |
2559 | |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2560 virtual property_list get_factory_defaults_list (void) const |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2561 { |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2562 error ("base_graphics_object::get_factory_defaults_list: invalid graphics object"); |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2563 } |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2564 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2565 virtual bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2566 { |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2567 return base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2568 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2569 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2570 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2571 // currently not possible. |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2572 virtual std::string values_as_string (void); |
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2573 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2574 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2575 // currently not possible. |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
2576 virtual std::string value_as_string (const std::string& prop); |
18118
ca84d3c9dc24
set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
17822
diff
changeset
|
2577 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2578 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2579 // currently not possible. |
11074
8a3b7e8fcbbc
graphics.cc, graphics.h.in, genprops.awk: use octave_map and octave_scalar_map instead of Octave_map
John W. Eaton <jwe@octave.org>
parents:
10998
diff
changeset
|
2580 virtual octave_scalar_map values_as_struct (void); |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2581 |
6874 | 2582 virtual graphics_handle get_parent (void) const |
2583 { | |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2584 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2585 error ("base_graphics_object::get_parent: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2586 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2587 return get_properties ().get_parent (); |
6874 | 2588 } |
2589 | |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2590 graphics_handle get_handle (void) const |
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2591 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2592 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2593 error ("base_graphics_object::get_handle: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2594 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2595 return get_properties ().get___myhandle__ (); |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2596 } |
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2597 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2598 virtual void remove_child (const graphics_handle& h, bool from_root = false) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2599 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2600 if (! valid_object ()) |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2601 error ("base_graphics_object::remove_child: invalid graphics object"); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2602 |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2603 get_properties ().remove_child (h, from_root); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2604 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2605 |
7386 | 2606 virtual void adopt (const graphics_handle& h) |
6874 | 2607 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2608 if (! valid_object ()) |
7386 | 2609 error ("base_graphics_object::adopt: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2610 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2611 get_properties ().adopt (h); |
6874 | 2612 } |
2613 | |
7386 | 2614 virtual void reparent (const graphics_handle& np) |
6874 | 2615 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2616 if (! valid_object ()) |
7386 | 2617 error ("base_graphics_object::reparent: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2618 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2619 get_properties ().reparent (np); |
6874 | 2620 } |
2621 | |
2622 virtual void defaults (void) const | |
2623 { | |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2624 if (! valid_object ()) |
7386 | 2625 error ("base_graphics_object::default: invalid graphics object"); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2626 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2627 std::string msg = (type () + "::defaults"); |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21055
diff
changeset
|
2628 err_not_implemented (msg.c_str ()); |
6874 | 2629 } |
2630 | |
2631 virtual base_properties& get_properties (void) | |
2632 { | |
2633 static base_properties properties; | |
22190
e68128601f5e
skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents:
22069
diff
changeset
|
2634 warning ("base_graphics_object::get_properties: invalid graphics object"); |
e68128601f5e
skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents:
22069
diff
changeset
|
2635 return properties; |
6874 | 2636 } |
2637 | |
7222 | 2638 virtual const base_properties& get_properties (void) const |
2639 { | |
2640 static base_properties properties; | |
22190
e68128601f5e
skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents:
22069
diff
changeset
|
2641 warning ("base_graphics_object::get_properties: invalid graphics object"); |
e68128601f5e
skip invalid objects in Qt graphics event handlers (bug #46501)
John W. Eaton <jwe@octave.org>
parents:
22069
diff
changeset
|
2642 return properties; |
7222 | 2643 } |
2644 | |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2645 virtual void update_axis_limits (const std::string& axis_type); |
7214 | 2646 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2647 virtual void update_axis_limits (const std::string& axis_type, |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2648 const graphics_handle& h); |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2649 |
6874 | 2650 virtual bool valid_object (void) const { return false; } |
2651 | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2652 bool valid_toolkit_object (void) const { return m_toolkit_flag; } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2653 |
7386 | 2654 virtual std::string type (void) const |
2655 { | |
2656 return (valid_object () ? get_properties ().graphics_object_name () | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2657 : "unknown"); |
7386 | 2658 } |
6874 | 2659 |
2660 bool isa (const std::string& go_name) const | |
2661 { | |
2662 return type () == go_name; | |
2663 } | |
2664 | |
27734
a9780be9ecbc
move graphics_toolkit class inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27730
diff
changeset
|
2665 virtual octave::graphics_toolkit get_toolkit (void) const |
7419 | 2666 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2667 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2668 error ("base_graphics_object::get_toolkit: invalid graphics object"); |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2669 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2670 return get_properties ().get_toolkit (); |
7419 | 2671 } |
2672 | |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2673 virtual void add_property_listener (const std::string& nm, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
2674 const octave_value& v, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2675 listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2676 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2677 if (valid_object ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2678 get_properties ().add_listener (nm, v, mode); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2679 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2680 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2681 virtual void delete_property_listener (const std::string& nm, |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
2682 const octave_value& v, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2683 listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2684 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2685 if (valid_object ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2686 get_properties ().delete_listener (nm, v, mode); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2687 } |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2688 |
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2689 virtual void remove_all_listeners (void); |
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2690 |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2691 virtual void reset_default_properties (void); |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
2692 |
6874 | 2693 protected: |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2694 virtual void initialize (const graphics_object& go) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2695 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2696 if (! m_toolkit_flag) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2697 m_toolkit_flag = get_toolkit ().initialize (go); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2698 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2699 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2700 virtual void finalize (const graphics_object& go) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2701 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2702 if (m_toolkit_flag) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2703 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2704 get_toolkit ().finalize (go); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2705 m_toolkit_flag = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2706 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2707 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2708 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2709 virtual void update (const graphics_object& go, int id) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2710 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2711 if (m_toolkit_flag) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2712 get_toolkit ().update (go, id); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2713 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2714 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2715 protected: |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
2716 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2717 // A flag telling whether this object is a valid object |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2718 // in the backend context. |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2719 bool m_toolkit_flag; |
6874 | 2720 }; |
2721 | |
7365 | 2722 class OCTINTERP_API graphics_object |
6874 | 2723 { |
2724 public: | |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2725 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2726 graphics_object (void) : m_rep (new base_graphics_object ()) { } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2727 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2728 graphics_object (base_graphics_object *new_rep) : m_rep (new_rep) { } |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2729 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
2730 graphics_object (const graphics_object&) = default; |
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
2731 |
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
2732 graphics_object& operator = (const graphics_object&) = default; |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2733 |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2734 ~graphics_object (void) = default; |
6874 | 2735 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2736 void mark_modified (void) { m_rep->mark_modified (); } |
6874 | 2737 |
2738 void override_defaults (base_graphics_object& obj) | |
2739 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2740 m_rep->override_defaults (obj); |
6874 | 2741 } |
2742 | |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
2743 void override_defaults (void) |
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
2744 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2745 m_rep->override_defaults (*m_rep); |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
2746 } |
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
2747 |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23401
diff
changeset
|
2748 void build_user_defaults_map (property_list::pval_map_type& def, |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2749 const std::string go_name) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2750 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2751 m_rep->build_user_defaults_map (def, go_name); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2752 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2753 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2754 void set_from_list (property_list& plist) { m_rep->set_from_list (plist); } |
6874 | 2755 |
7189 | 2756 void set (const caseless_str& name, const octave_value& val) |
6874 | 2757 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2758 m_rep->set (name, val); |
6874 | 2759 } |
2760 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2761 OCTINTERP_API void set (const octave_value_list& args); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2762 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2763 OCTINTERP_API void set (const Array<std::string>& names, const Cell& values, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2764 octave_idx_type row); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2765 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2766 OCTINTERP_API void set (const octave_map& m); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2767 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2768 OCTINTERP_API void set_value_or_default (const caseless_str& name, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2769 const octave_value& val); |
10056
33ba83a06a42
Fix set function to allow cell and struct arguments.
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
9972
diff
changeset
|
2770 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2771 void set_defaults (const std::string& mode) { m_rep->set_defaults (mode); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2772 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2773 octave_value get (bool all = false) const { return m_rep->get (all); } |
6874 | 2774 |
7189 | 2775 octave_value get (const caseless_str& name) const |
6874 | 2776 { |
2777 return name.compare ("default") | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2778 ? get_defaults () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2779 : (name.compare ("factory") |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2780 ? get_factory_defaults () : m_rep->get (name)); |
6874 | 2781 } |
2782 | |
9620
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2783 octave_value get (const std::string& name) const |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2784 { |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2785 return get (caseless_str (name)); |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2786 } |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2787 |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2788 octave_value get (const char *name) const |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2789 { |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2790 return get (caseless_str (name)); |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2791 } |
b00af0da85dd
graphics.h.in: provide std::string and char* versions of graphics_object:get functions
John W. Eaton <jwe@octave.org>
parents:
9616
diff
changeset
|
2792 |
7189 | 2793 octave_value get_default (const caseless_str& name) const |
6874 | 2794 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2795 return m_rep->get_default (name); |
6874 | 2796 } |
2797 | |
7189 | 2798 octave_value get_factory_default (const caseless_str& name) const |
6874 | 2799 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2800 return m_rep->get_factory_default (name); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2801 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2802 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2803 octave_value get_defaults (void) const { return m_rep->get_defaults (); } |
6874 | 2804 |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2805 property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2806 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2807 return m_rep->get_defaults_list (); |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2808 } |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2809 |
6874 | 2810 octave_value get_factory_defaults (void) const |
2811 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2812 return m_rep->get_factory_defaults (); |
6874 | 2813 } |
2814 | |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2815 property_list get_factory_defaults_list (void) const |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2816 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2817 return m_rep->get_factory_defaults_list (); |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2818 } |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2819 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2820 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2821 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2822 return m_rep->has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2823 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2824 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2825 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2826 // currently not possible. |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2827 std::string values_as_string (void) { return m_rep->values_as_string (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2828 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2829 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2830 // currently not possible. |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2831 std::string value_as_string (const std::string& prop) |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2832 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2833 return m_rep->value_as_string (prop); |
18118
ca84d3c9dc24
set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
17822
diff
changeset
|
2834 } |
ca84d3c9dc24
set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
17822
diff
changeset
|
2835 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2836 // FIXME: It seems like this function should be const, but that is |
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2837 // currently not possible. |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2838 octave_map values_as_struct (void) { return m_rep->values_as_struct (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2839 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2840 graphics_handle get_parent (void) const { return m_rep->get_parent (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2841 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2842 graphics_handle get_handle (void) const { return m_rep->get_handle (); } |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2843 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2844 OCTINTERP_API graphics_object get_ancestor (const std::string& type) const; |
11250
830b940e7ff4
Turn xget_ancestor into regular API
Michael Goffioul <michael.goffioul@gmail.com>
parents:
11247
diff
changeset
|
2845 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2846 void remove_child (const graphics_handle& h) { m_rep->remove_child (h); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2847 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2848 void adopt (const graphics_handle& h) { m_rep->adopt (h); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2849 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2850 void reparent (const graphics_handle& h) { m_rep->reparent (h); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2851 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2852 void defaults (void) const { m_rep->defaults (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2853 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2854 bool isa (const std::string& go_name) const { return m_rep->isa (go_name); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2855 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2856 base_properties& get_properties (void) { return m_rep->get_properties (); } |
6874 | 2857 |
7222 | 2858 const base_properties& get_properties (void) const |
2859 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2860 return m_rep->get_properties (); |
7222 | 2861 } |
2862 | |
7214 | 2863 void update_axis_limits (const std::string& axis_type) |
2864 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2865 m_rep->update_axis_limits (axis_type); |
7214 | 2866 } |
2867 | |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2868 void update_axis_limits (const std::string& axis_type, |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2869 const graphics_handle& h) |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2870 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2871 m_rep->update_axis_limits (axis_type, h); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2872 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2873 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2874 bool valid_object (void) const { return m_rep->valid_object (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2875 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2876 std::string type (void) const { return m_rep->type (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2877 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2878 operator bool (void) const { return m_rep->valid_object (); } |
6874 | 2879 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
2880 // FIXME: These functions should be generated automatically by the |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2881 // genprops.awk script. |
7222 | 2882 // |
2883 // EMIT_GRAPHICS_OBJECT_GET_FUNCTIONS | |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2884 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2885 octave_value get_alim (void) const |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2886 { return get_properties ().get_alim (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2887 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2888 octave_value get_clim (void) const |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2889 { return get_properties ().get_clim (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2890 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2891 octave_value get_xlim (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2892 { return get_properties ().get_xlim (); } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2893 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2894 octave_value get_ylim (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2895 { return get_properties ().get_ylim (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2896 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2897 octave_value get_zlim (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2898 { return get_properties ().get_zlim (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2899 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2900 bool is_aliminclude (void) const |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2901 { return get_properties ().is_aliminclude (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2902 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2903 bool is_climinclude (void) const |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2904 { return get_properties ().is_climinclude (); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2905 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2906 bool is_xliminclude (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2907 { return get_properties ().is_xliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2908 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2909 bool is_yliminclude (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2910 { return get_properties ().is_yliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2911 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2912 bool is_zliminclude (void) const |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2913 { return get_properties ().is_zliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2914 |
8249 | 2915 bool is_handle_visible (void) const |
2916 { return get_properties ().is_handle_visible (); } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2917 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2918 octave::graphics_toolkit get_toolkit (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2919 { return m_rep->get_toolkit (); } |
7408 | 2920 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2921 void add_property_listener (const std::string& nm, const octave_value& v, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2922 listener_mode mode = GCB_POSTSET) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2923 { m_rep->add_property_listener (nm, v, mode); } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2924 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2925 void delete_property_listener (const std::string& nm, const octave_value& v, |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2926 listener_mode mode = GCB_POSTSET) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2927 { m_rep->delete_property_listener (nm, v, mode); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2928 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2929 void remove_all_listeners (void) { m_rep->remove_all_listeners (); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2930 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2931 void initialize (void) { m_rep->initialize (*this); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2932 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2933 void finalize (void) { m_rep->finalize (*this); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2934 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2935 void update (int id) { m_rep->update (*this, id); } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2936 |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
2937 void reset_default_properties (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2938 { m_rep->reset_default_properties (); } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
2939 |
7408 | 2940 private: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2941 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2942 std::shared_ptr<base_graphics_object> m_rep; |
7408 | 2943 }; |
2944 | |
2945 // --------------------------------------------------------------------- | |
2946 | |
7365 | 2947 class OCTINTERP_API root_figure : public base_graphics_object |
6874 | 2948 { |
2949 public: | |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2950 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2951 // The gh_manager constructor creates the single instance of |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2952 // the root_figure object. |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2953 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2954 friend class gh_manager; |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2955 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
2956 class OCTINTERP_API properties : public base_properties |
6874 | 2957 { |
2958 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2959 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2960 remove_child (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2961 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2962 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2963 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2964 const Matrix& parent_pix_size = Matrix ()) const; |
14357
e7c74f56cd03
fltk toolkit requires figure units to be "pixels". Bug # 35430.
Ben Abbott <bpabbott@mac.com>
parents:
14324
diff
changeset
|
2965 |
6874 | 2966 // See the genprops.awk script for an explanation of the |
2967 // properties declarations. | |
2968 | |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
2969 // FIXME: Properties that still don't have callbacks are: |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
2970 // monitorpositions, pointerlocation, pointerwindow. |
18764
89448a7523b2
Add some more callbacks for root properties (bug #42347).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18737
diff
changeset
|
2971 // Note that these properties are not yet used by Octave, so setting |
89448a7523b2
Add some more callbacks for root properties (bug #42347).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18737
diff
changeset
|
2972 // them will have no effect. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2973 |
20459
564e59f75ef8
Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents:
20428
diff
changeset
|
2974 // FIXME: The commandwindowsize property has been deprecated in Matlab |
564e59f75ef8
Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents:
20428
diff
changeset
|
2975 // and is now available through matlab.desktop.comandwindow.size. |
564e59f75ef8
Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents:
20428
diff
changeset
|
2976 // Until Octave has something similar, keep this property in root. |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
2977 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2978 // Programming note: Keep property list sorted if new ones are added. |
9778 | 2979 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
2980 BEGIN_PROPERTIES (root_figure, root) |
9778 | 2981 handle_property callbackobject Sr , graphics_handle () |
2982 array_property commandwindowsize r , Matrix (1, 2, 0) | |
7363 | 2983 handle_property currentfigure S , graphics_handle () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2984 string_property fixedwidthfontname , "Courier" |
21952
a5924b0cbf42
Return "Screensize" for root graphics property "MonitorPositions" (partial fix bug #48239).
Rik <rik@octave.org>
parents:
21948
diff
changeset
|
2985 array_property monitorpositions r , default_screensize () |
10949
848f3a13b7cf
Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents:
10948
diff
changeset
|
2986 array_property pointerlocation , Matrix (1, 2, 0) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2987 double_property pointerwindow r , 0.0 |
8560
5cc594679cdc
get display characteristics from system
John W. Eaton <jwe@octave.org>
parents:
8465
diff
changeset
|
2988 double_property screendepth r , default_screendepth () |
9778 | 2989 double_property screenpixelsperinch r , default_screenpixelsperinch () |
10949
848f3a13b7cf
Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents:
10948
diff
changeset
|
2990 array_property screensize r , default_screensize () |
9778 | 2991 bool_property showhiddenhandles , "off" |
25903
06c41d1ae5b1
Allow 'characters' as a value for the Units property of root object (bug #54742).
Rik <rik@octave.org>
parents:
25891
diff
changeset
|
2992 radio_property units U , "{pixels}|inches|centimeters|points|normalized|characters" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2993 // Hide base properties which don't make sense for root object |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2994 //radio_property beingdeleted h , "{off}|on" |
6874 | 2995 END_PROPERTIES |
2996 }; | |
2997 | |
2998 private: | |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2999 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3000 properties m_properties; |
6874 | 3001 |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3002 protected: |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3003 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3004 root_figure (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3005 : m_properties (0, graphics_handle ()), m_default_properties (), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3006 m_factory_properties (init_factory_properties ()) |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3007 { } |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3008 |
6874 | 3009 public: |
3010 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
3011 ~root_figure (void) = default; |
6874 | 3012 |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3013 root_figure (const root_figure&) = delete; |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3014 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3015 root_figure& operator = (const root_figure&) = delete; |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3016 |
6874 | 3017 void mark_modified (void) { } |
3018 | |
3019 void override_defaults (base_graphics_object& obj) | |
3020 { | |
3021 // Now override with our defaults. If the default_properties | |
3022 // list includes the properties for all defaults (line, | |
3023 // surface, etc.) then we don't have to know the type of OBJ | |
3024 // here, we just call its set function and let it decide which | |
3025 // properties from the list to use. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3026 obj.set_from_list (m_default_properties); |
6874 | 3027 } |
3028 | |
7189 | 3029 void set (const caseless_str& name, const octave_value& value) |
6874 | 3030 { |
3031 if (name.compare ("default", 7)) | |
3032 // strip "default", pass rest to function that will | |
3033 // parse the remainder and add the element to the | |
3034 // default_properties map. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3035 m_default_properties.set (name.substr (7), value); |
6874 | 3036 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3037 m_properties.set (name, value); |
6874 | 3038 } |
3039 | |
7189 | 3040 octave_value get (const caseless_str& name) const |
6874 | 3041 { |
3042 octave_value retval; | |
3043 | |
3044 if (name.compare ("default", 7)) | |
3045 return get_default (name.substr (7)); | |
3046 else if (name.compare ("factory", 7)) | |
3047 return get_factory_default (name.substr (7)); | |
3048 else | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3049 retval = m_properties.get (name); |
6874 | 3050 |
3051 return retval; | |
3052 } | |
3053 | |
7189 | 3054 octave_value get_default (const caseless_str& name) const |
6874 | 3055 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3056 octave_value retval = m_default_properties.lookup (name); |
6874 | 3057 |
3058 if (retval.is_undefined ()) | |
7847
40b16e04172a
Make backend switching work.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7846
diff
changeset
|
3059 { |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3060 // no default property found, use factory default |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3061 retval = m_factory_properties.lookup (name); |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3062 |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3063 if (retval.is_undefined ()) |
15468
6437fa7263dd
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
3064 error ("get: invalid default property '%s'", name.c_str ()); |
7847
40b16e04172a
Make backend switching work.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7846
diff
changeset
|
3065 } |
6874 | 3066 |
3067 return retval; | |
3068 } | |
3069 | |
7189 | 3070 octave_value get_factory_default (const caseless_str& name) const |
6874 | 3071 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3072 octave_value retval = m_factory_properties.lookup (name); |
6874 | 3073 |
3074 if (retval.is_undefined ()) | |
15468
6437fa7263dd
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
3075 error ("get: invalid factory default property '%s'", name.c_str ()); |
6874 | 3076 |
3077 return retval; | |
3078 } | |
3079 | |
3080 octave_value get_defaults (void) const | |
3081 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3082 return m_default_properties.as_struct ("default"); |
6874 | 3083 } |
3084 | |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3085 property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3086 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3087 return m_default_properties; |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3088 } |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3089 |
6874 | 3090 octave_value get_factory_defaults (void) const |
3091 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3092 return m_factory_properties.as_struct ("factory"); |
6874 | 3093 } |
3094 | |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
3095 property_list get_factory_defaults_list (void) const |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
3096 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3097 return m_factory_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3098 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3099 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3100 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3101 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3102 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 3103 |
6874 | 3104 bool valid_object (void) const { return true; } |
3105 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3106 OCTINTERP_API void reset_default_properties (void); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3107 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3108 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3109 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3110 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3111 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3112 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3113 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3114 } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
3115 |
6874 | 3116 private: |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3117 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3118 property_list m_default_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3119 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3120 property_list m_factory_properties; |
6874 | 3121 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3122 static OCTINTERP_API property_list::plist_map_type |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3123 init_factory_properties (void); |
6874 | 3124 }; |
3125 | |
3126 // --------------------------------------------------------------------- | |
3127 | |
7365 | 3128 class OCTINTERP_API figure : public base_graphics_object |
6874 | 3129 { |
3130 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3131 |
7445 | 3132 class OCTINTERP_API properties : public base_properties |
6874 | 3133 { |
3134 public: | |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
3135 void init_integerhandle (const octave_value& val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3136 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3137 m_integerhandle = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3138 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
3139 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3140 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3141 remove_child (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3142 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3143 OCTINTERP_API void set_visible (const octave_value& val); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3144 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3145 OCTINTERP_API octave::graphics_toolkit get_toolkit (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3146 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3147 OCTINTERP_API void set_toolkit (const octave::graphics_toolkit& b); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3148 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3149 OCTINTERP_API void set___graphics_toolkit__ (const octave_value& val); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3150 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3151 OCTINTERP_API void adopt (const graphics_handle& h); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3152 |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3153 // Alias "innerposition" to "position". |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3154 octave_value get_innerposition (void) const |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3155 { |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3156 return get_position (); |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3157 } |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3158 |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3159 void set_innerposition (const octave_value& val) |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3160 { |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3161 set_position (val); |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3162 } |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3163 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3164 OCTINTERP_API void set_position (const octave_value& val, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3165 bool do_notify_toolkit = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3166 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3167 OCTINTERP_API void set_outerposition (const octave_value& val, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3168 bool do_notify_toolkit = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3169 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3170 OCTINTERP_API Matrix bbox2position (const Matrix& bbox) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3171 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3172 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3173 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3174 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3175 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3176 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3177 set_boundingbox (const Matrix& bb, bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3178 bool do_notify_toolkit = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3179 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3180 OCTINTERP_API Matrix map_from_boundingbox (double x, double y) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3181 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3182 OCTINTERP_API Matrix map_to_boundingbox (double x, double y) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3183 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3184 OCTINTERP_API void update_units (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3185 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3186 OCTINTERP_API void update_paperunits (const caseless_str& old_paperunits); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3187 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3188 OCTINTERP_API std::string get_title (void) const; |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
3189 |
6874 | 3190 // See the genprops.awk script for an explanation of the |
3191 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3192 // Programming note: Keep property list sorted if new ones are added. |
6874 | 3193 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
3194 BEGIN_PROPERTIES (figure) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3195 array_property alphamap , Matrix (64, 1, 1) |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3196 callback_property buttondownfcn , Matrix () |
7363 | 3197 callback_property closerequestfcn , "closereq" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3198 color_property color , color_property (color_values (1, 1, 1), radio_values ("none")) |
20761
47cec845dd5a
Set default colormap to viridis
Carlo de Falco <carlo.defalco@polimi.it>
parents:
20756
diff
changeset
|
3199 array_property colormap , viridis_colormap () |
7363 | 3200 handle_property currentaxes S , graphics_handle () |
7405 | 3201 string_property currentcharacter r , "" |
3202 handle_property currentobject r , graphics_handle () | |
10517 | 3203 array_property currentpoint r , Matrix (2, 1, 0) |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3204 bool_property dockcontrols , "on" |
11247
29b1f7d68665
make filename property of figure objects writable
John W. Eaton <jwe@octave.org>
parents:
11175
diff
changeset
|
3205 string_property filename , "" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3206 bool_property graphicssmoothing , "on" |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3207 array_property innerposition sg , default_figure_position () |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
3208 bool_property integerhandle S , "on" |
21323
030d4d6c2b58
Implement figure property "InvertHardCopy" for printing (bug #47230).
Rik <rik@octave.org>
parents:
21289
diff
changeset
|
3209 bool_property inverthardcopy , "on" |
7405 | 3210 callback_property keypressfcn , Matrix () |
3211 callback_property keyreleasefcn , Matrix () | |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3212 radio_property menubar , "{figure}|none" |
7405 | 3213 string_property name , "" |
25273
ac6ba9f2fa41
Add new Figure graphic property "Number" (bug #53343).
Rik <rik@octave.org>
parents:
25173
diff
changeset
|
3214 array_property number rG , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3215 radio_property nextplot , "{add}|new|replace|replacechildren" |
7405 | 3216 bool_property numbertitle , "on" |
13713
d99aa455296e
Add outerposition property to figure objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13703
diff
changeset
|
3217 array_property outerposition s , Matrix (1, 4, -1.0) |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3218 radio_property paperorientation U , "{portrait}|landscape" |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3219 array_property paperposition m , default_figure_paperposition () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3220 // FIXME: Matlab default is "auto", but this messes up hgsave BIST test. |
27432
1e79d913baaa
Change default figure property "paperpositionmode" to "auto" (bug #56916).
Rik <rik@octave.org>
parents:
27335
diff
changeset
|
3221 radio_property paperpositionmode au , "{auto}|manual" |
10991
9d3a7ad94ee6
Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents:
10990
diff
changeset
|
3222 array_property papersize U , default_figure_papersize () |
9d3a7ad94ee6
Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents:
10990
diff
changeset
|
3223 radio_property papertype SU , "{usletter}|uslegal|a0|a1|a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-d|arch-e|a|b|c|d|e|tabloid|<custom>" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3224 radio_property paperunits Su , "{inches}|centimeters|normalized|points" |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3225 radio_property pointer , "{arrow}|crosshair|ibeam|watch|topl|topr|botl|botr|left|top|right|bottom|circle|cross|fleur|custom|hand" |
27099
2cd31365c84a
Implement "pointer" and related figure properties for Qt toolkit (bug #56347)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26985
diff
changeset
|
3226 array_property pointershapecdata , Matrix (16, 16, 1) |
2cd31365c84a
Implement "pointer" and related figure properties for Qt toolkit (bug #56347)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26985
diff
changeset
|
3227 array_property pointershapehotspot , Matrix (1, 2, 1) |
13713
d99aa455296e
Add outerposition property to figure objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13703
diff
changeset
|
3228 array_property position s , default_figure_position () |
21367
0035733e4b3a
graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents:
21323
diff
changeset
|
3229 radio_property renderer m , "{opengl}|painters" |
7405 | 3230 radio_property renderermode , "{auto}|manual" |
3231 bool_property resize , "on" | |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
3232 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
3233 // and has been replaced with "sizechangedfcn" |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3234 // Eventually this will need to be hidden, and then removed. |
7405 | 3235 callback_property resizefcn , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3236 radio_property selectiontype , "{normal}|extend|alt|open" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3237 callback_property sizechangedfcn , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3238 radio_property toolbar , "{auto}|figure|none" |
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3239 radio_property units Su , "{pixels}|normalized|inches|centimeters|points|characters" |
7405 | 3240 callback_property windowbuttondownfcn , Matrix () |
3241 callback_property windowbuttonmotionfcn , Matrix () | |
3242 callback_property windowbuttonupfcn , Matrix () | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3243 callback_property windowkeypressfcn , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3244 callback_property windowkeyreleasefcn , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3245 callback_property windowscrollwheelfcn , Matrix () |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3246 radio_property windowstate , "{normal}|minimized|maximized|fullscreen" |
7405 | 3247 radio_property windowstyle , "{normal}|modal|docked" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3248 |
24687
8b935067a257
Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24637
diff
changeset
|
3249 // Overridden base property |
24637
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3250 // Property is not implemented for figures. |
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3251 // Hide it and set it to a default value that works. |
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3252 radio_property pickableparts h , "{visible}" |
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3253 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3254 // Octave-specific properties |
21684
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3255 mutable string_property __gl_extensions__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3256 mutable string_property __gl_renderer__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3257 mutable string_property __gl_vendor__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3258 mutable string_property __gl_version__ hr , "" |
24687
8b935067a257
Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24637
diff
changeset
|
3259 bool_property __gl_window__ h , "off" |
23774
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23763
diff
changeset
|
3260 string_property __graphics_toolkit__ hs , default_graphics_toolkit () |
13699
dd9b32af0a01
Implement guidata/guihandles.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13324
diff
changeset
|
3261 any_property __guidata__ h , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3262 radio_property __mouse_mode__ hS , "{none}|pan|rotate|select|text|zoom" |
24687
8b935067a257
Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24637
diff
changeset
|
3263 bool_property __printing__ h , "off" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3264 any_property __pan_mode__ h , Matrix () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3265 any_property __plot_stream__ h , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3266 any_property __rotate_mode__ h , Matrix () |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3267 any_property __zoom_mode__ h , Matrix () |
25884
4e108574385c
Improve OpenGL rendering on high resolution screens with Qt 5 (bug #49053)
John Swensen <jpswensen@gmail.com>
parents:
25867
diff
changeset
|
3268 double_property __device_pixel_ratio__ hU , 1.0 |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3269 |
6874 | 3270 END_PROPERTIES |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
3271 |
7363 | 3272 protected: |
3273 void init (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3274 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3275 m_alphamap.add_constraint (dim_vector (-1, 1)); |
30053
0b67964031be
allow figure alphamap property to be a column vector (bug #61085)
John W. Eaton <jwe@octave.org>
parents:
30040
diff
changeset
|
3276 m_alphamap.add_constraint (dim_vector (1, -1)); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3277 m_colormap.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3278 m_colormap.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3279 m_outerposition.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3280 m_outerposition.add_constraint (FINITE); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3281 m_paperposition.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3282 m_paperposition.add_constraint (FINITE); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3283 m_papersize.add_constraint (dim_vector (1, 2)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3284 m_papersize.add_constraint (FINITE); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3285 m_pointershapecdata.add_constraint (dim_vector (16, 16)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3286 m_pointershapecdata.add_constraint (dim_vector (32, 32)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3287 m_pointershapehotspot.add_constraint (dim_vector (1, 2)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3288 m_position.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3289 m_position.add_constraint (FINITE); |
27709
0a84a7d0998d
don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents:
27698
diff
changeset
|
3290 |
0a84a7d0998d
don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents:
27698
diff
changeset
|
3291 init_toolkit (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3292 } |
7408 | 3293 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3294 private: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3295 OCTINTERP_API Matrix get_auto_paperposition (void); |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3296 |
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3297 void update_paperpositionmode (void) |
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3298 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3299 if (m_paperpositionmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3300 m_paperposition.set (get_auto_paperposition ()); |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3301 } |
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3302 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3303 OCTINTERP_API void update_handlevisibility (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3304 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3305 OCTINTERP_API void init_toolkit (void); |
27709
0a84a7d0998d
don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents:
27698
diff
changeset
|
3306 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3307 octave::graphics_toolkit m_toolkit; |
6874 | 3308 }; |
3309 | |
3310 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3311 properties m_properties; |
6874 | 3312 |
3313 public: | |
3314 figure (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3315 : base_graphics_object (), m_properties (mh, p), m_default_properties () |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
3316 { } |
6874 | 3317 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
3318 ~figure (void) = default; |
6874 | 3319 |
3320 void override_defaults (base_graphics_object& obj) | |
3321 { | |
26878
3c7c5b7c3044
doc: Refer to "root object" rather than "root figure object".
Rik <rik@octave.org>
parents:
26520
diff
changeset
|
3322 // Allow parent (root object) to override first (properties knows how |
6874 | 3323 // to find the parent object). |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3324 m_properties.override_defaults (obj); |
6874 | 3325 |
3326 // Now override with our defaults. If the default_properties | |
3327 // list includes the properties for all defaults (line, | |
3328 // surface, etc.) then we don't have to know the type of OBJ | |
3329 // here, we just call its set function and let it decide which | |
3330 // properties from the list to use. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3331 obj.set_from_list (m_default_properties); |
6874 | 3332 } |
3333 | |
7189 | 3334 void set (const caseless_str& name, const octave_value& value) |
6874 | 3335 { |
3336 if (name.compare ("default", 7)) | |
3337 // strip "default", pass rest to function that will | |
3338 // parse the remainder and add the element to the | |
3339 // default_properties map. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3340 m_default_properties.set (name.substr (7), value); |
6874 | 3341 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3342 m_properties.set (name, value); |
6874 | 3343 } |
3344 | |
7189 | 3345 octave_value get (const caseless_str& name) const |
6874 | 3346 { |
3347 octave_value retval; | |
3348 | |
3349 if (name.compare ("default", 7)) | |
3350 retval = get_default (name.substr (7)); | |
3351 else | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3352 retval = m_properties.get (name); |
6874 | 3353 |
3354 return retval; | |
3355 } | |
3356 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3357 OCTINTERP_API octave_value get_default (const caseless_str& name) const; |
6874 | 3358 |
3359 octave_value get_defaults (void) const | |
3360 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3361 return m_default_properties.as_struct ("default"); |
6874 | 3362 } |
3363 | |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3364 property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3365 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3366 return m_default_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3367 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3368 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3369 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3370 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3371 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 3372 |
6874 | 3373 bool valid_object (void) const { return true; } |
3374 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3375 OCTINTERP_API void reset_default_properties (void); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3376 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3377 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3378 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3379 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3380 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3381 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3382 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
3383 } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
3384 |
6874 | 3385 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3386 property_list m_default_properties; |
6874 | 3387 }; |
3388 | |
3389 // --------------------------------------------------------------------- | |
3390 | |
7435 | 3391 class OCTINTERP_API graphics_xform |
3392 { | |
3393 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3394 |
7435 | 3395 graphics_xform (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3396 : m_xform (xform_eye ()), m_xform_inv (xform_eye ()), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3397 m_sx ("linear"), m_sy ("linear"), m_sz ("linear"), m_zlim (1, 2, 0.0) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3398 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3399 m_zlim(1) = 1.0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3400 } |
7435 | 3401 |
3402 graphics_xform (const Matrix& xm, const Matrix& xim, | |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
3403 const scaler& x, const scaler& y, const scaler& z, |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
3404 const Matrix& zl) |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3405 : m_xform (xm), m_xform_inv (xim), m_sx (x), m_sy (y), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3406 m_sz (z), m_zlim (zl) |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3407 { } |
7435 | 3408 |
3409 graphics_xform (const graphics_xform& g) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3410 : m_xform (g.m_xform), m_xform_inv (g.m_xform_inv), m_sx (g.m_sx), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3411 m_sy (g.m_sy), m_sz (g.m_sz), m_zlim (g.m_zlim) { } |
7435 | 3412 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
3413 ~graphics_xform (void) = default; |
7435 | 3414 |
3415 graphics_xform& operator = (const graphics_xform& g) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3416 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3417 m_xform = g.m_xform; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3418 m_xform_inv = g.m_xform_inv; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3419 m_sx = g.m_sx; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3420 m_sy = g.m_sy; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3421 m_sz = g.m_sz; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3422 m_zlim = g.m_zlim; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3423 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3424 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3425 } |
7435 | 3426 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3427 static OCTINTERP_API ColumnVector xform_vector (double x, double y, double z); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3428 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3429 static OCTINTERP_API Matrix xform_eye (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3430 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3431 OCTINTERP_API ColumnVector |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3432 transform (double x, double y, double z, bool use_scale = true) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3433 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3434 OCTINTERP_API ColumnVector |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3435 untransform (double x, double y, double z, bool use_scale = true) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
3436 |
10553 | 3437 ColumnVector untransform (double x, double y, bool use_scale = true) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3438 { return untransform (x, y, (m_zlim(0)+m_zlim(1))/2, use_scale); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3439 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3440 Matrix xscale (const Matrix& m) const { return m_sx.scale (m); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3441 Matrix yscale (const Matrix& m) const { return m_sy.scale (m); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3442 Matrix zscale (const Matrix& m) const { return m_sz.scale (m); } |
7435 | 3443 |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
3444 Matrix scale (const Matrix& m) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3445 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3446 bool has_z = (m.columns () > 2); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3447 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3448 if (m_sx.is_linear () && m_sy.is_linear () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3449 && (! has_z || m_sz.is_linear ())) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3450 return m; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3451 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3452 Matrix retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3453 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3454 int r = m.rows (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3455 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3456 for (int i = 0; i < r; i++) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3457 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3458 retval(i,0) = m_sx.scale (m(i,0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3459 retval(i,1) = m_sy.scale (m(i,1)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3460 if (has_z) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3461 retval(i,2) = m_sz.scale (m(i,2)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3462 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3463 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3464 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3465 } |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
3466 |
7435 | 3467 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3468 Matrix m_xform; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3469 Matrix m_xform_inv; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3470 scaler m_sx, m_sy, m_sz; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3471 Matrix m_zlim; |
7435 | 3472 }; |
3473 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3474 enum |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3475 { |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3476 AXE_ANY_DIR = 0, |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3477 AXE_DEPTH_DIR = 1, |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3478 AXE_HORZ_DIR = 2, |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3479 AXE_VERT_DIR = 3 |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3480 }; |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3481 |
7365 | 3482 class OCTINTERP_API axes : public base_graphics_object |
6874 | 3483 { |
3484 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3485 |
7445 | 3486 class OCTINTERP_API properties : public base_properties |
6874 | 3487 { |
3488 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3489 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3490 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3491 set_defaults (base_graphics_object& obj, const std::string& mode); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3492 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3493 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3494 remove_child (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3495 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3496 OCTINTERP_API void adopt (const graphics_handle& h); |
25423
13b1b9a0d9c5
Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents:
25418
diff
changeset
|
3497 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3498 const scaler& get_x_scaler (void) const { return m_sx; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3499 const scaler& get_y_scaler (void) const { return m_sy; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3500 const scaler& get_z_scaler (void) const { return m_sz; } |
7427 | 3501 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3502 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3503 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3504 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3505 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3506 get_extent (bool with_text = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3507 bool only_text_height=false) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3508 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3509 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3510 get___fontsize_points__ (double box_pix_height = 0) const; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
3511 |
7828
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
3512 void update_boundingbox (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3513 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3514 if (units_is ("normalized")) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3515 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3516 sync_positions (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3517 base_properties::update_boundingbox (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3518 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3519 } |
7828
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
3520 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3521 OCTINTERP_API void update_camera (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3522 OCTINTERP_API void update_axes_layout (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3523 OCTINTERP_API void update_aspectratios (void); |
7427 | 3524 void update_transform (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3525 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3526 update_aspectratios (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3527 update_camera (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3528 update_axes_layout (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3529 } |
7427 | 3530 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3531 OCTINTERP_API void sync_positions (void); |
17098
786bcce466e9
Initialize the tightinset during initialization of axes.
Ben Abbott <bpabbott@mac.com>
parents:
17011
diff
changeset
|
3532 |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3533 // Redirect calls to "activepositionproperty" to "positionconstraint". |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3534 |
28693
2bb050267d74
maint: Remove trailing spaces from code base.
Rik <rik@octave.org>
parents:
28414
diff
changeset
|
3535 std::string get_activepositionproperty (void) const |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3536 { |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3537 std::string cur_val; |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3538 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3539 if (m_positionconstraint.is ("innerposition")) |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3540 cur_val = "position"; |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3541 else |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3542 cur_val = "outerposition"; |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3543 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3544 return cur_val; |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3545 } |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3546 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3547 void set_activepositionproperty (const octave_value& val) |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3548 { |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3549 // call set method to validate the input |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3550 m_activepositionproperty.set (val); |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3551 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3552 if (val.char_matrix_value ().row_as_string (0) == "position") |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3553 set_positionconstraint ("innerposition"); |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3554 else |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3555 set_positionconstraint (val); |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3556 } |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3557 |
28302
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3558 // Redirect calls to "innerposition" to "position". |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3559 |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3560 octave_value get_innerposition (void) const |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3561 { |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3562 return get_position (); |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3563 } |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3564 |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3565 void set_innerposition (const octave_value& val) |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3566 { |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3567 set_position (val); |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3568 } |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3569 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3570 OCTINTERP_API void update_autopos (const std::string& elem_type); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3571 OCTINTERP_API void update_xlabel_position (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3572 OCTINTERP_API void update_ylabel_position (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3573 OCTINTERP_API void update_zlabel_position (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3574 OCTINTERP_API void update_title_position (void); |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
3575 |
7435 | 3576 graphics_xform get_transform (void) const |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3577 { |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3578 return graphics_xform (m_x_render, m_x_render_inv, |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3579 m_sx, m_sy, m_sz, m_x_zlim); |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3580 } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3581 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3582 Matrix get_transform_matrix (void) const { return m_x_render; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3583 Matrix get_inverse_transform_matrix (void) const { return m_x_render_inv; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3584 Matrix get_opengl_matrix_1 (void) const { return m_x_gl_mat1; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3585 Matrix get_opengl_matrix_2 (void) const { return m_x_gl_mat2; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3586 Matrix get_transform_zlim (void) const { return m_x_zlim; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3587 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3588 int get_xstate (void) const { return m_xstate; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3589 int get_ystate (void) const { return m_ystate; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3590 int get_zstate (void) const { return m_zstate; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3591 double get_xPlane (void) const { return m_xPlane; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3592 double get_xPlaneN (void) const { return m_xPlaneN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3593 double get_yPlane (void) const { return m_yPlane; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3594 double get_yPlaneN (void) const { return m_yPlaneN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3595 double get_zPlane (void) const { return m_zPlane; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3596 double get_zPlaneN (void) const { return m_zPlaneN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3597 double get_xpTick (void) const { return m_xpTick; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3598 double get_xpTickN (void) const { return m_xpTickN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3599 double get_ypTick (void) const { return m_ypTick; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3600 double get_ypTickN (void) const { return m_ypTickN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3601 double get_zpTick (void) const { return m_zpTick; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3602 double get_zpTickN (void) const { return m_zpTickN; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3603 double get_x_min (void) const { return std::min (m_xPlane, m_xPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3604 double get_x_max (void) const { return std::max (m_xPlane, m_xPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3605 double get_y_min (void) const { return std::min (m_yPlane, m_yPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3606 double get_y_max (void) const { return std::max (m_yPlane, m_yPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3607 double get_z_min (void) const { return std::min (m_zPlane, m_zPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3608 double get_z_max (void) const { return std::max (m_zPlane, m_zPlaneN); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3609 double get_fx (void) const { return m_fx; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3610 double get_fy (void) const { return m_fy; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3611 double get_fz (void) const { return m_fz; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3612 double get_xticklen (void) const { return m_xticklen; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3613 double get_yticklen (void) const { return m_yticklen; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3614 double get_zticklen (void) const { return m_zticklen; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3615 double get_xtickoffset (void) const { return m_xtickoffset; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3616 double get_ytickoffset (void) const { return m_ytickoffset; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3617 double get_ztickoffset (void) const { return m_ztickoffset; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3618 bool get_x2Dtop (void) const { return m_x2Dtop; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3619 bool get_y2Dright (void) const { return m_y2Dright; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3620 bool get_layer2Dtop (void) const { return m_layer2Dtop; } |
23859
7148b237f94f
Fix regression introduced by cset 06805aabbdd1 (bug #50750).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23803
diff
changeset
|
3621 bool get_is2D (bool include_kids = false) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3622 { return (include_kids ? (m_is2D && ! m_has3Dkids) : m_is2D); } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3623 void set_has3Dkids (bool val) { m_has3Dkids = val; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3624 bool get_xySym (void) const { return m_xySym; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3625 bool get_xyzSym (void) const { return m_xyzSym; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3626 bool get_zSign (void) const { return m_zSign; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3627 bool get_nearhoriz (void) const { return m_nearhoriz; } |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3628 |
7842
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3629 ColumnVector pixel2coord (double px, double py) const |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3630 { |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3631 return get_transform ().untransform (px, py, |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3632 (m_x_zlim(0)+m_x_zlim(1))/2); |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3633 } |
7842
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3634 |
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3635 ColumnVector coord2pixel (double x, double y, double z) const |
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3636 { return get_transform ().transform (x, y, z); } |
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3637 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3638 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3639 zoom_about_point (const std::string& mode, double x, double y, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3640 double factor, bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3641 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3642 zoom (const std::string& mode, double factor, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3643 bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3644 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3645 zoom (const std::string& mode, const Matrix& xl, const Matrix& yl, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3646 bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3647 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3648 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3649 translate_view (const std::string& mode, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3650 double x0, double x1, double y0, double y1, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3651 bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3652 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3653 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3654 pan (const std::string& mode, double factor, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3655 bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3656 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3657 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3658 rotate3d (double x0, double x1, double y0, double y1, |
19663
dfea01b3425f
more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents:
19659
diff
changeset
|
3659 bool push_to_zoom_stack = true); |
dfea01b3425f
more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents:
19659
diff
changeset
|
3660 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3661 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3662 rotate_view (double delta_az, double delta_el, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3663 bool push_to_zoom_stack = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3664 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3665 OCTINTERP_API void unzoom (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3666 OCTINTERP_API void update_handlevisibility (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3667 OCTINTERP_API void push_zoom_stack (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3668 OCTINTERP_API void clear_zoom_stack (bool do_unzoom = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3669 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3670 OCTINTERP_API void update_units (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3671 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3672 OCTINTERP_API void update_font (std::string prop = ""); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3673 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3674 OCTINTERP_API void update_fontunits (const caseless_str& old_fontunits); |
10991
9d3a7ad94ee6
Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents:
10990
diff
changeset
|
3675 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3676 void increase_num_lights (void) { m_num_lights++; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3677 void decrease_num_lights (void) { m_num_lights--; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3678 unsigned int get_num_lights (void) const { return m_num_lights; } |
25423
13b1b9a0d9c5
Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents:
25418
diff
changeset
|
3679 |
7427 | 3680 private: |
23401
e0c20a22da7e
eliminate some errors exposed by -fsanitize=undefined
John W. Eaton <jwe@octave.org>
parents:
23396
diff
changeset
|
3681 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3682 scaler m_sx = scaler (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3683 scaler m_sy = scaler (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3684 scaler m_sz = scaler (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3685 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3686 Matrix m_x_render = Matrix (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3687 Matrix m_x_render_inv = Matrix (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3688 Matrix m_x_gl_mat1 = Matrix (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3689 Matrix m_x_gl_mat2 = Matrix (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3690 Matrix m_x_zlim = Matrix (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3691 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3692 std::list<octave_value> m_zoom_stack = std::list<octave_value> (); |
7427 | 3693 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3694 // Axes layout data |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3695 int m_xstate = 0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3696 int m_ystate = 0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3697 int m_zstate = 0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3698 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3699 double m_xPlane = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3700 double m_yPlane = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3701 double m_zPlane = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3702 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3703 double m_xPlaneN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3704 double m_yPlaneN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3705 double m_zPlaneN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3706 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3707 double m_xpTick = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3708 double m_ypTick = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3709 double m_zpTick = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3710 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3711 double m_xpTickN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3712 double m_ypTickN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3713 double m_zpTickN = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3714 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3715 double m_fx = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3716 double m_fy = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3717 double m_fz = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3718 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3719 double m_xticklen = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3720 double m_yticklen = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3721 double m_zticklen = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3722 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3723 double m_xtickoffset = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3724 double m_ytickoffset = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3725 double m_ztickoffset = 0.0; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3726 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3727 bool m_x2Dtop = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3728 bool m_y2Dright = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3729 bool m_layer2Dtop = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3730 bool m_is2D = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3731 bool m_has3Dkids = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3732 bool m_xySym = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3733 bool m_xyzSym = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3734 bool m_zSign = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3735 bool m_nearhoriz = false; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3736 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3737 unsigned int m_num_lights = 0; |
25423
13b1b9a0d9c5
Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents:
25418
diff
changeset
|
3738 |
21209
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
3739 // Text renderer, used for calculation of text (tick labels) size |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3740 octave::text_renderer m_txt_renderer; |
12777
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
3741 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3742 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3743 set_text_child (handle_property& h, const std::string& who, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3744 const octave_value& v); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3745 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3746 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3747 delete_text_child (handle_property& h, bool from_root = false); |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
3748 |
6874 | 3749 // See the genprops.awk script for an explanation of the |
3750 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3751 // Programming note: Keep property list sorted if new ones are added. |
8222
11badf6c9e9f
__go_draw_axes__.m: Support axes interpreter poperty for tick labels.
Ben Abbott <bpabbott@mac.com>
parents:
8210
diff
changeset
|
3752 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
3753 BEGIN_PROPERTIES (axes) |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3754 radio_property activepositionproperty gsh , "{outerposition}|position" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3755 row_vector_property alim m , default_lim () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3756 radio_property alimmode , "{auto}|manual" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3757 // FIXME: not yet implemented |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3758 array_property alphamap , Matrix () |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3759 radio_property alphascale , "{linear}|log" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3760 color_property ambientlightcolor , color_values (1, 1, 1) |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
3761 bool_property box u , "off" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3762 radio_property boxstyle , "{back}|full" |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3763 row_vector_property cameraposition mu , Matrix (1, 3, 0.0) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3764 radio_property camerapositionmode u , "{auto}|manual" |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3765 row_vector_property cameratarget mu , Matrix (1, 3, 0.0) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3766 radio_property cameratargetmode u , "{auto}|manual" |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3767 row_vector_property cameraupvector mu , Matrix (1, 3, 0.0) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3768 radio_property cameraupvectormode u , "{auto}|manual" |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3769 double_property cameraviewangle mu , 6.6086 |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3770 radio_property cameraviewanglemode u , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3771 row_vector_property clim m , default_lim () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3772 radio_property climmode al , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3773 radio_property clippingstyle , "{3dbox}|rectangle" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3774 color_property color , color_property (color_values (1, 1, 1), radio_values ("none")) |
23524
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
3775 array_property colormap sg , Matrix () |
7363 | 3776 array_property colororder , default_colororder () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3777 double_property colororderindex , 1.0 |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3778 radio_property colorscale , "{linear}|log" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3779 array_property currentpoint , Matrix (2, 3, 0.0) |
23067
6825dd6bbe39
Change some axes properties to row_vector_property (bug #50048).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23057
diff
changeset
|
3780 row_vector_property dataaspectratio mu , Matrix (1, 3, 1.0) |
11167
51ac3a08e53c
Fix {d,pb}aspectratios for OpenGL backends.
Konstantinos Poulios <logari81@googlemail.com>
parents:
11163
diff
changeset
|
3781 radio_property dataaspectratiomode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3782 radio_property fontangle u , "{normal}|italic" |
12777
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
3783 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3784 double_property fontsize mu , 10 |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3785 // FIXME: not yet implemented |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3786 radio_property fontsizemode , "{auto}|manual" |
26858
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
3787 bool_property fontsmoothing u , "on" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3788 radio_property fontunits SU , "{points}|inches|centimeters|normalized|pixels" |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3789 radio_property fontweight u , "{normal}|bold" |
21367
0035733e4b3a
graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents:
21323
diff
changeset
|
3790 double_property gridalpha m , 0.15 |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3791 radio_property gridalphamode , "{auto}|manual" |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
3792 color_property gridcolor m , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none")) |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3793 radio_property gridcolormode , "{auto}|manual" |
22056
05ad23810150
Use default gridlinestyle of '-' for Matlab compatibility.
Rik <rik@octave.org>
parents:
22022
diff
changeset
|
3794 radio_property gridlinestyle , "{-}|--|:|-.|none" |
28302
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3795 array_property innerposition sg , default_axes_position () |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3796 // FIXME: Should be an array of "interaction objects". |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3797 // Make it read-only for now. |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3798 any_property interactions r , Matrix () |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
3799 double_property labelfontsizemultiplier u , 1.1 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3800 radio_property layer u , "{bottom}|top" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3801 // FIXME: Should be a "layoutoptions" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3802 handle_property layout r , graphics_handle () |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3803 // FIXME: Should be a "legend" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3804 handle_property legend r , graphics_handle () |
17382
50b2863d10a6
Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents:
17104
diff
changeset
|
3805 // FIXME: should be kind of string array. |
50b2863d10a6
Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents:
17104
diff
changeset
|
3806 any_property linestyleorder S , "-" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3807 double_property linestyleorderindex , 1.0 |
7403 | 3808 double_property linewidth , 0.5 |
21367
0035733e4b3a
graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents:
21323
diff
changeset
|
3809 double_property minorgridalpha m , 0.25 |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3810 radio_property minorgridalphamode , "{auto}|manual" |
21367
0035733e4b3a
graphics.in.h: Make sure XXXmode properties switch to "manual" if XXX is set.
Rik <rik@octave.org>
parents:
21323
diff
changeset
|
3811 color_property minorgridcolor m , color_property (color_values (0.1, 0.1, 0.1), radio_values ("none")) |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3812 radio_property minorgridcolormode , "{auto}|manual" |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3813 radio_property minorgridlinestyle , "{:}|-|--|-.|none" |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3814 radio_property nextplot , "{replace}|add|replacechildren" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3815 double_property nextseriesindex r , 1.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3816 array_property outerposition u , default_axes_outerposition () |
23067
6825dd6bbe39
Change some axes properties to row_vector_property (bug #50048).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23057
diff
changeset
|
3817 row_vector_property plotboxaspectratio mu , Matrix (1, 3, 1.0) |
11167
51ac3a08e53c
Fix {d,pb}aspectratios for OpenGL backends.
Konstantinos Poulios <logari81@googlemail.com>
parents:
11163
diff
changeset
|
3818 radio_property plotboxaspectratiomode u , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3819 array_property position u , default_axes_position () |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3820 radio_property positionconstraint , "{outerposition}|innerposition" |
18819
92e9d4710f78
Fix typo in graphics.in.h (bug #42535).
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17822
diff
changeset
|
3821 radio_property projection , "{orthographic}|perspective" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3822 radio_property sortmethod , "{depth}|childorder" |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3823 radio_property tickdir mu , "{in}|out" |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3824 radio_property tickdirmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3825 // FIXME: Added recently to Matlab, should replace interpreter property. |
26055
8b9e6a39e0a2
Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26045
diff
changeset
|
3826 radio_property ticklabelinterpreter u , "{tex}|latex|none" |
14391
c9ec21bef97a
Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents:
14357
diff
changeset
|
3827 array_property ticklength u , default_axes_ticklength () |
7403 | 3828 array_property tightinset r , Matrix (1, 4, 0.0) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3829 handle_property title SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
3830 double_property titlefontsizemultiplier u , 1.1 |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
3831 radio_property titlefontweight u , "{bold}|normal" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3832 // FIXME: Should be a "axestoolbar" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3833 handle_property toolbar r , graphics_handle () |
10991
9d3a7ad94ee6
Respect the units and paperunits figure properties and the units and fontunits axes properties
David Bateman <dbateman@free.fr>
parents:
10990
diff
changeset
|
3834 radio_property units SU , "{normalized}|inches|centimeters|points|pixels|characters" |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
3835 array_property view u , default_axes_view () |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3836 // FIXME: Should be a "ruler" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3837 handle_property xaxis r , graphics_handle () |
24976
47f25e164ab1
Delete graphics properties or allowed values scheduled for deprecation in 4.6
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24795
diff
changeset
|
3838 radio_property xaxislocation u , "{bottom}|top|origin" |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
3839 color_property xcolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none")) |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3840 radio_property xcolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3841 radio_property xdir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3842 bool_property xgrid , "off" |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3843 handle_property xlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3844 row_vector_property xlim mu , default_lim () |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
3845 radio_property xlimitmethod u , "{tickaligned}|tight|padded" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3846 radio_property xlimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3847 bool_property xminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3848 bool_property xminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3849 radio_property xscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3850 row_vector_property xtick mu , default_axes_tick () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3851 // FIXME: should be kind of string array. |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3852 any_property xticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3853 radio_property xticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3854 double_property xticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3855 radio_property xtickmode u , "{auto}|manual" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3856 // FIXME: Should be a "ruler" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3857 handle_property yaxis r , graphics_handle () |
24976
47f25e164ab1
Delete graphics properties or allowed values scheduled for deprecation in 4.6
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24795
diff
changeset
|
3858 radio_property yaxislocation u , "{left}|right|origin" |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
3859 color_property ycolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none")) |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3860 radio_property ycolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3861 radio_property ydir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3862 bool_property ygrid , "off" |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3863 handle_property ylabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3864 row_vector_property ylim mu , default_lim () |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
3865 radio_property ylimitmethod u , "{tickaligned}|tight|padded" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3866 radio_property ylimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3867 bool_property yminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3868 bool_property yminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3869 radio_property yscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3870 row_vector_property ytick mu , default_axes_tick () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3871 any_property yticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3872 radio_property yticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3873 double_property yticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3874 radio_property ytickmode u , "{auto}|manual" |
28282
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3875 // FIXME: Should be a "ruler" object. Make it read-only for now. |
044cea7947db
Add new properties to "axes" graphics object (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28079
diff
changeset
|
3876 handle_property zaxis r , graphics_handle () |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
3877 color_property zcolor mu , color_property (color_values (0.15, 0.15, 0.15), radio_values ("none")) |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3878 radio_property zcolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3879 radio_property zdir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3880 bool_property zgrid , "off" |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3881 handle_property zlabel SOf , make_graphics_handle ("text", m___myhandle__, false, false, false) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3882 row_vector_property zlim mu , default_lim () |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
3883 radio_property zlimitmethod u , "{tickaligned}|tight|padded" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3884 radio_property zlimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3885 bool_property zminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3886 bool_property zminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3887 radio_property zscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3888 row_vector_property ztick mu , default_axes_tick () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3889 any_property zticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3890 radio_property zticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3891 double_property zticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3892 radio_property ztickmode u , "{auto}|manual" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3893 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3894 // Octave-specific properties |
24501
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
3895 array_property __colormap__ hu , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3896 double_property mousewheelzoom , 0.5 |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3897 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3898 // hidden properties for alignment of subplots |
22622
4191f8b5070c
Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
3899 radio_property __autopos_tag__ h , "{none}|subplot" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3900 // hidden properties for inset |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3901 array_property looseinset hu , Matrix (1, 4, 0.0) |
12126
85f9a5b211fd
restructuring draw_axes, enabling minor ticks/grid in fltk, closing bug 31800
Konstantinos Poulios <logari81@googlemail.com>
parents:
11586
diff
changeset
|
3902 // hidden properties for minor ticks |
22623
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3903 row_vector_property xminortickvalues h , Matrix () |
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3904 row_vector_property yminortickvalues h , Matrix () |
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3905 row_vector_property zminortickvalues h , Matrix () |
19047
1288a2f27769
Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19044
diff
changeset
|
3906 // hidden property for text rendering |
22622
4191f8b5070c
Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
3907 double_property __fontsize_points__ hgr , 0 |
7189 | 3908 END_PROPERTIES |
6874 | 3909 |
7363 | 3910 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3911 OCTINTERP_API void init (void); |
7427 | 3912 |
3913 private: | |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3914 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3915 std::string |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3916 get_scale (const std::string& scale, const Matrix& lims) |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3917 { |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3918 std::string retval = scale; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3919 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3920 if (scale == "log" && lims.numel () > 1 && lims(0) < 0 && lims(1) < 0) |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3921 retval = "neglog"; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3922 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3923 return retval; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3924 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3925 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3926 void update_xscale (void) |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3927 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3928 m_sx = get_scale (get_xscale (), m_xlim.get ().matrix_value ()); |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3929 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3930 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3931 void update_yscale (void) |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3932 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3933 m_sy = get_scale (get_yscale (), m_ylim.get ().matrix_value ()); |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3934 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3935 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3936 void update_zscale (void) |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3937 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3938 m_sz = get_scale (get_zscale (), m_zlim.get ().matrix_value ()); |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3939 } |
7427 | 3940 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3941 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3942 update_label_color (handle_property label, color_property col); |
23001
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3943 void update_xcolor (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3944 { update_label_color (m_xlabel, m_xcolor); } |
23001
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3945 |
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3946 void update_ycolor (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3947 { update_label_color (m_ylabel, m_ycolor); } |
23001
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3948 |
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3949 void update_zcolor (void) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3950 { update_label_color (m_zlabel, m_zcolor); } |
23001
14f1738a56ae
Use C++ updaters for labels color (bug #49980).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22619
diff
changeset
|
3951 |
12440
2ed62b9f949e
synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12433
diff
changeset
|
3952 void update_view (void) { sync_positions (); } |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3953 |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3954 void update_cameraposition (void) { update_transform (); } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3955 void update_cameratarget (void) { update_transform (); } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3956 void update_cameraupvector (void) { update_transform (); } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3957 void update_cameraviewangle (void) { update_transform (); } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3958 |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3959 void update_camerapositionmode (void) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3960 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3961 if (camerapositionmode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3962 update_cameraposition (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3963 } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3964 void update_cameratargetmode (void) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3965 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3966 if (cameratargetmode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3967 update_cameratarget (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3968 } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3969 void update_cameraupvectormode (void) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3970 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3971 if (cameraupvectormode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3972 update_cameraupvector (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3973 } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3974 void update_cameraviewanglemode (void) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3975 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3976 if (cameraviewanglemode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3977 update_cameraviewangle (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3978 } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3979 |
12441
b932ae4381da
improvements in synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12440
diff
changeset
|
3980 void update_dataaspectratio (void) { sync_positions (); } |
b932ae4381da
improvements in synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12440
diff
changeset
|
3981 void update_dataaspectratiomode (void) { sync_positions (); } |
b932ae4381da
improvements in synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12440
diff
changeset
|
3982 void update_plotboxaspectratio (void) { sync_positions (); } |
b932ae4381da
improvements in synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12440
diff
changeset
|
3983 void update_plotboxaspectratiomode (void) { sync_positions (); } |
7427 | 3984 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3985 void update_layer (void) { update_axes_layout (); } |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
3986 void update_box (void) |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
3987 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3988 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3989 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
3990 xaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3991 m_yscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
3992 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
3993 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3994 m_xlim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3995 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3996 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
3997 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3998 m_xscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
3999 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4000 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4001 m_ylim); |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4002 } |
12503
2c66314447f1
update axis label position after axis location changes
Konstantinos Poulios <logari81@gmail.com>
parents:
12496
diff
changeset
|
4003 void update_yaxislocation (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4004 { |
19652
5b4fd7ebcfc6
Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19597
diff
changeset
|
4005 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4006 update_axes_layout (); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4007 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4008 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4009 xaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4010 m_yscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4011 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4012 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4013 m_xlim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4014 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4015 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4016 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4017 m_xscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4018 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4019 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4020 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4021 update_ylabel_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4022 } |
12503
2c66314447f1
update axis label position after axis location changes
Konstantinos Poulios <logari81@gmail.com>
parents:
12496
diff
changeset
|
4023 void update_xaxislocation (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4024 { |
19652
5b4fd7ebcfc6
Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19597
diff
changeset
|
4025 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4026 update_axes_layout (); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4027 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4028 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4029 xaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4030 m_yscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4031 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4032 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4033 m_xlim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4034 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4035 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4036 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4037 m_xscale.is ("log") ? 2 : |
24191
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4038 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4039 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4040 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4041 update_xlabel_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4042 } |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4043 |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4044 void update_xdir (void) { update_camera (); update_axes_layout (); } |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4045 void update_ydir (void) { update_camera (); update_axes_layout (); } |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4046 void update_zdir (void) { update_camera (); update_axes_layout (); } |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4047 |
14391
c9ec21bef97a
Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents:
14357
diff
changeset
|
4048 void update_ticklength (void); |
c9ec21bef97a
Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents:
14357
diff
changeset
|
4049 void update_tickdir (void) { update_ticklength (); } |
c9ec21bef97a
Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents:
14357
diff
changeset
|
4050 void update_tickdirmode (void) { update_ticklength (); } |
7446 | 4051 |
26055
8b9e6a39e0a2
Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26045
diff
changeset
|
4052 void update_ticklabelinterpreter (void) |
8b9e6a39e0a2
Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26045
diff
changeset
|
4053 { |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4054 update_xtick (false); |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4055 update_ytick (false); |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4056 update_ztick (true); |
26055
8b9e6a39e0a2
Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26045
diff
changeset
|
4057 } |
26469
bf835b1d04b1
Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26383
diff
changeset
|
4058 |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4059 void update_xtick (bool sync_pos = true) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4060 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4061 calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4062 m_xlimmode.is ("auto"), m_xtickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4063 m_xscale.is ("log"), m_xlimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4064 m_xlimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4065 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4066 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4067 xaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4068 m_yscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4069 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4070 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4071 m_xlim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4072 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4073 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4074 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4075 } |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4076 void update_ytick (bool sync_pos = true) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4077 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4078 calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4079 m_ylimmode.is ("auto"), m_ytickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4080 m_yscale.is ("log"), m_ylimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4081 m_ylimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4082 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4083 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4084 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4085 m_xscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4086 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4087 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4088 m_ylim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4089 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4090 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4091 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4092 } |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4093 void update_ztick (bool sync_pos = true) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4094 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4095 calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4096 m_zlimmode.is ("auto"), m_ztickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4097 m_zscale.is ("log"), m_zlimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4098 m_zlimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4099 if (m_zticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4100 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4101 2, m_zlim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4102 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4103 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4104 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4105 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4106 |
11394
ecd87194adb6
Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents:
11385
diff
changeset
|
4107 void update_xtickmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4108 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4109 if (m_xtickmode.is ("auto")) |
22710
0cbe4714ce1b
Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22665
diff
changeset
|
4110 update_xtick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4111 } |
11394
ecd87194adb6
Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents:
11385
diff
changeset
|
4112 void update_ytickmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4113 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4114 if (m_ytickmode.is ("auto")) |
22710
0cbe4714ce1b
Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22665
diff
changeset
|
4115 update_ytick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4116 } |
11394
ecd87194adb6
Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents:
11385
diff
changeset
|
4117 void update_ztickmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4118 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4119 if (m_ztickmode.is ("auto")) |
22710
0cbe4714ce1b
Correct locations of minor grid lines for manual ticks (bug #45850).
Markus Mützel <markus.muetzel@gmx.de>
parents:
22665
diff
changeset
|
4120 update_ztick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4121 } |
11394
ecd87194adb6
Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents:
11385
diff
changeset
|
4122 |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4123 void update_xticklabelmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4124 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4125 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4126 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4127 xaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4128 m_yscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4129 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4130 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4131 m_xlim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4132 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4133 void update_yticklabelmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4134 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4135 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4136 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4137 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4138 m_xscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4139 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4140 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4141 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4142 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4143 void update_zticklabelmode (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4144 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4145 if (m_zticklabelmode.is ("auto")) |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
4146 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
4147 false, 2, m_zlim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4148 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4149 |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4150 void update_fontname (void) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4151 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4152 update_font ("fontname"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4153 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4154 } |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4155 void update_fontsize (void) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4156 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4157 update_font ("fontsize"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4158 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4159 } |
26858
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4160 void update_fontsmoothing (void) |
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4161 { |
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4162 update_font ("fontsmoothing"); |
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4163 } |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4164 void update_fontangle (void) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4165 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4166 update_font ("fontangle"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4167 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4168 } |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4169 void update_fontweight (void) |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4170 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4171 update_font ("fontweight"); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4172 sync_positions (); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4173 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4174 |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4175 void update_titlefontsizemultiplier (void) |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4176 { |
26371
87f11da73b19
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4177 // update_font handles title and axis labels |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4178 update_font ("fontsize"); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4179 sync_positions (); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4180 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4181 |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4182 void update_labelfontsizemultiplier (void) |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4183 { |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4184 update_font ("fontsize"); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4185 sync_positions (); |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4186 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4187 |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4188 void update_titlefontweight (void) |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4189 { |
26371
87f11da73b19
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4190 // update_font handles title and axis labels |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4191 update_font ("fontweight"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4192 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4193 } |
12777
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
4194 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4195 OCTINTERP_API void update_outerposition (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4196 OCTINTERP_API void update_position (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4197 OCTINTERP_API void update_looseinset (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4198 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4199 OCTINTERP_API double calc_tick_sep (double minval, double maxval); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4200 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4201 calc_ticks_and_lims (array_property& lims, array_property& ticks, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4202 array_property& mticks, bool limmode_is_auto, |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4203 bool tickmode_is_auto, bool is_logscale, |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4204 bool method_is_padded, bool method_is_tight); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4205 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4206 calc_ticklabels (const array_property& ticks, any_property& labels, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4207 bool is_logscale, const bool is_origin, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4208 const int other_axislocation, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4209 const array_property& axis_lims); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4210 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4211 get_ticklabel_extents (const Matrix& ticks, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4212 const string_vector& ticklabels, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4213 const Matrix& limits); |
12334
63dc132a1000
Move axes labels and title positioning to axes::properties
Konstantinos Poulios <logari81@gmail.com>
parents:
12327
diff
changeset
|
4214 |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4215 void fix_limits (array_property& lims) |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4216 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
4217 if (lims.get ().isempty ()) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4218 return; |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4219 |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4220 Matrix l = lims.get ().matrix_value (); |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4221 if (l(0) > l(1)) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4222 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4223 l(0) = 0; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4224 l(1) = 1; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4225 lims = l; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4226 } |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4227 else if (l(0) == l(1)) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4228 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4229 l(0) -= 0.5; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4230 l(1) += 0.5; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4231 lims = l; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4232 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4233 } |
7446 | 4234 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4235 OCTINTERP_API Matrix calc_tightbox (const Matrix& init_pos); |
12440
2ed62b9f949e
synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12433
diff
changeset
|
4236 |
23524
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4237 void set_colormap (const octave_value& val) |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4238 { |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4239 set___colormap__ (val); |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4240 } |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4241 |
24501
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4242 void update___colormap__ (void) |
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4243 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4244 m_colormap.run_listeners (GCB_POSTSET); |
24501
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4245 } |
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4246 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4247 OCTINTERP_API octave_value get_colormap (void) const; |
23524
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4248 |
7446 | 4249 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4250 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4251 get_axis_limits (double xmin, double xmax, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4252 double min_pos, double max_neg, |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4253 const bool logscale, const std::string& method); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4254 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4255 OCTINTERP_API void |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
4256 check_axis_limits (Matrix& limits, const Matrix kids, |
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
4257 const bool logscale, char& update_type); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4258 |
19663
dfea01b3425f
more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents:
19659
diff
changeset
|
4259 void update_xlim () |
7446 | 4260 { |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4261 update_axis_limits ("xlim"); |
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4262 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4263 calc_ticks_and_lims (m_xlim, m_xtick, m_xminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4264 m_xlimmode.is ("auto"), m_xtickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4265 m_xscale.is ("log"), m_xlimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4266 m_xlimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4267 if (m_xticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4268 calc_ticklabels (m_xtick, m_xticklabel, m_xscale.is ("log"), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4269 m_xaxislocation.is ("origin"), |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4270 m_yscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4271 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4272 (yaxislocation_is ("left") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4273 m_xlim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4274 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4275 fix_limits (m_xlim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4276 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4277 update_xscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4278 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4279 update_axes_layout (); |
7446 | 4280 } |
4281 | |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4282 void update_xlimitmethod () |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4283 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4284 update_xlim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4285 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4286 |
19663
dfea01b3425f
more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents:
19659
diff
changeset
|
4287 void update_ylim (void) |
7446 | 4288 { |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4289 update_axis_limits ("ylim"); |
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4290 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4291 calc_ticks_and_lims (m_ylim, m_ytick, m_yminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4292 m_ylimmode.is ("auto"), m_ytickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4293 m_yscale.is ("log"), m_ylimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4294 m_ylimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4295 if (m_yticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4296 calc_ticklabels (m_ytick, m_yticklabel, m_yscale.is ("log"), |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4297 yaxislocation_is ("origin"), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4298 m_xscale.is ("log") ? 2 : |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4299 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4300 (xaxislocation_is ("bottom") ? -1 : 1)), |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4301 m_ylim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4302 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4303 fix_limits (m_ylim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4304 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4305 update_yscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4306 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4307 update_axes_layout (); |
7446 | 4308 } |
4309 | |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4310 void update_ylimitmethod () |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4311 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4312 update_ylim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4313 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4314 |
7446 | 4315 void update_zlim (void) |
4316 { | |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4317 update_axis_limits ("zlim"); |
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4318 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4319 calc_ticks_and_lims (m_zlim, m_ztick, m_zminortickvalues, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4320 m_zlimmode.is ("auto"), m_ztickmode.is ("auto"), |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4321 m_zscale.is ("log"), m_zlimitmethod.is ("padded"), |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4322 m_zlimitmethod.is ("tight")); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4323 if (m_zticklabelmode.is ("auto")) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4324 calc_ticklabels (m_ztick, m_zticklabel, m_zscale.is ("log"), false, |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4325 2, m_zlim); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4326 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4327 fix_limits (m_zlim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4328 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4329 update_zscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4330 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4331 update_axes_layout (); |
7446 | 4332 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4333 |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4334 void update_zlimitmethod () |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4335 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4336 update_zlim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4337 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4338 |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
4339 void trigger_normals_calc (void); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
4340 |
6874 | 4341 }; |
4342 | |
4343 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4344 properties m_properties; |
6874 | 4345 |
4346 public: | |
4347 axes (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4348 : base_graphics_object (), m_properties (mh, p), m_default_properties () |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4349 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4350 m_properties.update_transform (); |
6874 | 4351 } |
4352 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
4353 ~axes (void) = default; |
6874 | 4354 |
4355 void override_defaults (base_graphics_object& obj) | |
4356 { | |
4357 // Allow parent (figure) to override first (properties knows how | |
4358 // to find the parent object). | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4359 m_properties.override_defaults (obj); |
6874 | 4360 |
4361 // Now override with our defaults. If the default_properties | |
4362 // list includes the properties for all defaults (line, | |
4363 // surface, etc.) then we don't have to know the type of OBJ | |
4364 // here, we just call its set function and let it decide which | |
4365 // properties from the list to use. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4366 obj.set_from_list (m_default_properties); |
6874 | 4367 } |
4368 | |
7189 | 4369 void set (const caseless_str& name, const octave_value& value) |
6874 | 4370 { |
4371 if (name.compare ("default", 7)) | |
4372 // strip "default", pass rest to function that will | |
4373 // parse the remainder and add the element to the | |
4374 // default_properties map. | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4375 m_default_properties.set (name.substr (7), value); |
6874 | 4376 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4377 m_properties.set (name, value); |
6874 | 4378 } |
4379 | |
4380 void set_defaults (const std::string& mode) | |
4381 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4382 m_properties.set_defaults (*this, mode); |
6874 | 4383 } |
4384 | |
7189 | 4385 octave_value get (const caseless_str& name) const |
6874 | 4386 { |
4387 octave_value retval; | |
4388 | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4389 // FIXME: finish this. |
6874 | 4390 if (name.compare ("default", 7)) |
4391 retval = get_default (name.substr (7)); | |
4392 else | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4393 retval = m_properties.get (name); |
6874 | 4394 |
4395 return retval; | |
4396 } | |
4397 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4398 OCTINTERP_API octave_value get_default (const caseless_str& name) const; |
6874 | 4399 |
4400 octave_value get_defaults (void) const | |
4401 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4402 return m_default_properties.as_struct ("default"); |
6874 | 4403 } |
4404 | |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
4405 property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
4406 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4407 return m_default_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4408 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4409 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4410 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4411 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4412 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 4413 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4414 OCTINTERP_API void update_axis_limits (const std::string& axis_type); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4415 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4416 OCTINTERP_API void update_axis_limits (const std::string& axis_type, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4417 const graphics_handle& h); |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
4418 |
6874 | 4419 bool valid_object (void) const { return true; } |
4420 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4421 OCTINTERP_API void reset_default_properties (void); |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
4422 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4423 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4424 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4425 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4426 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4427 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4428 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4429 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4430 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
4431 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4432 OCTINTERP_API void initialize (const graphics_object& go); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
4433 |
6874 | 4434 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4435 property_list m_default_properties; |
6874 | 4436 }; |
4437 | |
4438 // --------------------------------------------------------------------- | |
4439 | |
7365 | 4440 class OCTINTERP_API line : public base_graphics_object |
6874 | 4441 { |
4442 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4443 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4444 class OCTINTERP_API properties : public base_properties |
6874 | 4445 { |
4446 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4447 |
6874 | 4448 // See the genprops.awk script for an explanation of the |
4449 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4450 // Programming note: Keep property list sorted if new ones are added. |
7366 | 4451 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4452 BEGIN_PROPERTIES (line) |
20738
f90295782d60
Accept color value of "none" for line objects (bug #44224).
Rik <rik@octave.org>
parents:
20730
diff
changeset
|
4453 color_property color , color_property (color_values (0, 0, 0), radio_values ("none")) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4454 string_property displayname , "" |
22759
39f39eb4e476
Implement "linejoin" property (bug #48387)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22755
diff
changeset
|
4455 radio_property linejoin , "{round}|miter|chamfer" |
7363 | 4456 radio_property linestyle , "{-}|--|:|-.|none" |
4457 double_property linewidth , 0.5 | |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
4458 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram" |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
4459 color_property markeredgecolor , color_property (radio_values ("{auto}|none"), color_values (0, 0, 0)) |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
4460 color_property markerfacecolor , color_property (radio_values ("auto|{none}"), color_values (0, 0, 0)) |
7363 | 4461 double_property markersize , 6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4462 row_vector_property xdata u , default_data () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4463 string_property xdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4464 row_vector_property ydata u , default_data () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4465 string_property ydatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4466 row_vector_property zdata u , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4467 string_property zdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4468 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4469 // hidden properties for limit computation |
26715
24e11ee4fe45
Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26712
diff
changeset
|
4470 row_vector_property xlim hlr , default_data_lim () |
24e11ee4fe45
Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26712
diff
changeset
|
4471 row_vector_property ylim hlr , default_data_lim () |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4472 row_vector_property zlim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4473 bool_property xliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4474 bool_property yliminclude hl , "on" |
26715
24e11ee4fe45
Improve calculation of zlim and aspect ratios for 2d objects (bug #55634).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26712
diff
changeset
|
4475 bool_property zliminclude hl , "on" |
6874 | 4476 END_PROPERTIES |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4477 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
4478 protected: |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
4479 void init (void) |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
4480 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4481 m_linewidth.add_constraint ("min", 0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4482 m_markersize.add_constraint ("min", 0, false); |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
4483 } |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
4484 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4485 private: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4486 OCTINTERP_API Matrix compute_xlim (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4487 OCTINTERP_API Matrix compute_ylim (void) const; |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4488 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4489 void update_xdata (void) { set_xlim (compute_xlim ()); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4490 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4491 void update_ydata (void) { set_ylim (compute_ylim ()); } |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4492 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4493 void update_zdata (void) { set_zlim (m_zdata.get_limits ()); } |
6874 | 4494 }; |
4495 | |
4496 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4497 properties m_properties; |
6874 | 4498 |
4499 public: | |
4500 line (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4501 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
4502 { } |
6874 | 4503 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
4504 ~line (void) = default; |
6874 | 4505 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4506 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4507 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4508 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 4509 |
6874 | 4510 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4511 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4512 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4513 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4514 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4515 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4516 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4517 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4518 } |
6874 | 4519 }; |
4520 | |
4521 // --------------------------------------------------------------------- | |
4522 | |
7365 | 4523 class OCTINTERP_API text : public base_graphics_object |
6874 | 4524 { |
4525 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4526 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4527 class OCTINTERP_API properties : public base_properties |
6874 | 4528 { |
4529 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4530 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4531 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4532 get___fontsize_points__ (double box_pix_height = 0) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4533 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4534 OCTINTERP_API void update_text_extent (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4535 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4536 OCTINTERP_API void update_font (void); |
25884
4e108574385c
Improve OpenGL rendering on high resolution screens with Qt 5 (bug #49053)
John Swensen <jpswensen@gmail.com>
parents:
25867
diff
changeset
|
4537 |
14448
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4538 void set_position (const octave_value& val) |
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4539 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4540 octave_value new_val (val); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4541 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4542 if (new_val.numel () == 2) |
14448
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4543 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4544 dim_vector dv (1, 3); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4545 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4546 new_val = new_val.resize (dv, true); |
14448
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4547 } |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4548 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4549 if (m_position.set (new_val, false)) |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4550 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4551 set_positionmode ("manual"); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4552 update_position (); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4553 m_position.run_listeners (GCB_POSTSET); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4554 mark_modified (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4555 } |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4556 else |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4557 set_positionmode ("manual"); |
14448
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4558 } |
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4559 |
6874 | 4560 // See the genprops.awk script for an explanation of the |
4561 // properties declarations. | |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
4562 // Programming note: Keep property list sorted if new ones are added. |
6874 | 4563 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4564 BEGIN_PROPERTIES (text) |
17646
993ea21b7e03
graphics.in.h: Text "edgecolor" property should default to "none".
Rik <rik@octave.org>
parents:
17645
diff
changeset
|
4565 color_property backgroundcolor , color_property (radio_values ("{none}"), color_values (1, 1, 1)) |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4566 color_property color u , color_property (color_values (0, 0, 0), radio_values ("none")) |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
4567 color_property edgecolor , color_property (radio_values ("{none}"), color_values (0, 0, 0)) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4568 bool_property editing , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4569 array_property extent rG , Matrix (1, 4, 0.0) |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
4570 radio_property fontangle u , "{normal}|italic" |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4571 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4572 double_property fontsize u , 10 |
26858
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4573 bool_property fontsmoothing u , "on" |
19047
1288a2f27769
Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19044
diff
changeset
|
4574 radio_property fontunits SU , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4575 radio_property fontweight u , "{normal}|bold" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4576 radio_property horizontalalignment mu , "{left}|center|right" |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4577 radio_property interpreter u , "{tex}|none|latex" |
7377 | 4578 radio_property linestyle , "{-}|--|:|-.|none" |
4579 double_property linewidth , 0.5 | |
26185
ef0998af70f9
Change "Margin" default of text object to 3.
Rik <rik@octave.org>
parents:
26129
diff
changeset
|
4580 double_property margin , 3 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4581 array_property position smu , Matrix (1, 3, 0.0) |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4582 double_property rotation mu , 0 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4583 text_label_property string u , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4584 radio_property units u , "{data}|pixels|normalized|inches|centimeters|points" |
11455
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
11394
diff
changeset
|
4585 radio_property verticalalignment mu , "top|cap|{middle}|baseline|bottom" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4586 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4587 // hidden properties for limit computation |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4588 row_vector_property xlim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4589 row_vector_property ylim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4590 row_vector_property zlim hlr , Matrix () |
11281
3f952c6973f7
graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents:
11250
diff
changeset
|
4591 bool_property xliminclude hl , "off" |
3f952c6973f7
graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents:
11250
diff
changeset
|
4592 bool_property yliminclude hl , "off" |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4593 bool_property zliminclude hl , "off" |
11385
71e7467fbd34
Disable auto-positioning of manually positioned title and axes labels.
Konstantinos Poulios <logari81@googlemail.com>
parents:
11384
diff
changeset
|
4594 // hidden properties for auto-positioning |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4595 radio_property positionmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4596 radio_property rotationmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4597 radio_property horizontalalignmentmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4598 radio_property verticalalignmentmode hu , "{auto}|manual" |
22622
4191f8b5070c
Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
4599 radio_property __autopos_tag__ h , "{none}|xlabel|ylabel|zlabel|title" |
19047
1288a2f27769
Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19044
diff
changeset
|
4600 // hidden property for text rendering |
22622
4191f8b5070c
Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
4601 double_property __fontsize_points__ hgr , 0 |
6874 | 4602 END_PROPERTIES |
4603 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4604 OCTINTERP_API Matrix get_data_position (void) const; |
29433
8811d8274118
Allow arbitrary text rotation onscreen (bug #33118)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29359
diff
changeset
|
4605 OCTINTERP_API Matrix get_extent_matrix (bool rotated = false) const; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4606 const uint8NDArray& get_pixels (void) const { return m_pixels; } |
21209
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
4607 |
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
4608 // Text renderer, used for calculation of text size |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4609 octave::text_renderer m_txt_renderer; |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4610 |
7363 | 4611 protected: |
4612 void init (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4613 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4614 m_position.add_constraint (dim_vector (1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4615 m_fontsize.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4616 m_linewidth.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4617 m_margin.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4618 m_cached_units = get_units (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4619 update_font (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4620 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4621 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4622 private: |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4623 void update_position (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4624 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4625 Matrix pos = get_data_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4626 Matrix lim; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4627 |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4628 lim = Matrix (1, 4, pos(0)); |
23450
855122b993da
maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
4629 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf () : lim(2)); |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4630 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf () : lim(3)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4631 set_xlim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4632 |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4633 lim = Matrix (1, 4, pos(1)); |
23450
855122b993da
maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
4634 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf () : lim(2)); |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4635 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf () : lim(3)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4636 set_ylim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4637 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4638 if (pos.numel () == 3) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4639 { |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4640 lim = Matrix (1, 4, pos(2)); |
23450
855122b993da
maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
4641 lim(2) = (lim(2) <= 0 ? octave::numeric_limits<double>::Inf () |
855122b993da
maint: Wrap tertiary operator in parentheses "(COND ? x : y)".
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
4642 : lim(2)); |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4643 lim(3) = (lim(3) >= 0 ? -octave::numeric_limits<double>::Inf () |
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4644 : lim(3)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4645 set_zlim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4646 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4647 } |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4648 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4649 OCTINTERP_API void request_autopos (void); |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4650 void update_positionmode (void) { request_autopos (); } |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4651 void update_rotationmode (void) { request_autopos (); } |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4652 void update_horizontalalignmentmode (void) { request_autopos (); } |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4653 void update_verticalalignmentmode (void) { request_autopos (); } |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4654 |
12440
2ed62b9f949e
synchronization of axes position and outerposition
Konstantinos Poulios <logari81@googlemail.com>
parents:
12433
diff
changeset
|
4655 void update_string (void) { request_autopos (); update_text_extent (); } |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4656 void update_rotation (void) { update_text_extent (); } |
12777
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
4657 void update_fontname (void) { update_font (); update_text_extent (); } |
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
4658 void update_fontsize (void) { update_font (); update_text_extent (); } |
26858
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4659 void update_fontsmoothing (void) { update_font (); update_text_extent (); } |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4660 |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4661 void update_color (void) |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4662 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4663 if (! m_color.is ("none")) |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4664 { |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4665 update_font (); |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4666 update_text_extent (); |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4667 } |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4668 } |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4669 |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4670 void update_fontangle (void) |
23396
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
4671 { |
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
4672 update_font (); |
23210
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
4673 update_text_extent (); |
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
4674 } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4675 void update_fontweight (void) { update_font (); update_text_extent (); } |
23210
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
4676 |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4677 void update_interpreter (void) { update_text_extent (); } |
11455
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
11394
diff
changeset
|
4678 void update_horizontalalignment (void) { update_text_extent (); } |
2be9e22796d2
improvements in text-extent calculation
Konstantinos Poulios <logari81@googlemail.com>
parents:
11394
diff
changeset
|
4679 void update_verticalalignment (void) { update_text_extent (); } |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4680 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4681 OCTINTERP_API void update_units (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4682 OCTINTERP_API void update_fontunits (const caseless_str& old_fontunits); |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4683 |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4684 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4685 std::string m_cached_units; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4686 uint8NDArray m_pixels; |
6874 | 4687 }; |
4688 | |
4689 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4690 properties m_properties; |
6874 | 4691 |
4692 public: | |
4693 text (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4694 : base_graphics_object (), m_properties (mh, p) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4695 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4696 m_properties.set_clipping ("off"); |
6874 | 4697 } |
4698 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
4699 ~text (void) = default; |
6874 | 4700 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4701 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4702 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4703 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 4704 |
6874 | 4705 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4706 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4707 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4708 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4709 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4710 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4711 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4712 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4713 } |
6874 | 4714 }; |
4715 | |
4716 // --------------------------------------------------------------------- | |
4717 | |
7365 | 4718 class OCTINTERP_API image : public base_graphics_object |
6874 | 4719 { |
4720 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4721 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4722 class OCTINTERP_API properties : public base_properties |
6874 | 4723 { |
4724 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4725 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4726 bool is_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4727 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4728 std::string get_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4729 { return m_aliminclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4730 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4731 bool is_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4732 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4733 std::string get_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4734 { return m_climinclude.current_value (); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4735 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4736 OCTINTERP_API octave_value get_color_data (void) const; |
9680
73153525df9a
initial implementation of OpenGL image rendering
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9620
diff
changeset
|
4737 |
19324
68db8396c378
Make "image ()" use the default image cdata
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19087
diff
changeset
|
4738 void initialize_data (void) { update_cdata (); } |
68db8396c378
Make "image ()" use the default image cdata
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19087
diff
changeset
|
4739 |
6874 | 4740 // See the genprops.awk script for an explanation of the |
4741 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4742 // Programming note: Keep property list sorted if new ones are added. |
6874 | 4743 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4744 BEGIN_PROPERTIES (image) |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
4745 array_property alphadata u , Matrix (1, 1, 1.0) |
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
4746 radio_property alphadatamapping al , "{none}|direct|scaled" |
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
4747 array_property cdata u , default_image_cdata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4748 radio_property cdatamapping al , "scaled|{direct}" |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4749 row_vector_property xdata mu , Matrix () |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4750 row_vector_property ydata mu , Matrix () |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4751 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4752 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4753 row_vector_property clim hlr , Matrix () |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
4754 row_vector_property xlim hlr , Matrix () |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
4755 row_vector_property ylim hlr , Matrix () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4756 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4757 bool_property climinclude hlg , "on" |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4758 bool_property xliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4759 bool_property yliminclude hl , "on" |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4760 radio_property xdatamode ha , "{auto}|manual" |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4761 radio_property ydatamode ha , "{auto}|manual" |
6874 | 4762 END_PROPERTIES |
4763 | |
7363 | 4764 protected: |
4765 void init (void) | |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4766 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4767 m_xdata.add_constraint (2); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4768 m_xdata.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4769 m_ydata.add_constraint (2); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4770 m_ydata.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4771 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4772 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4773 m_cdata.add_constraint ("logical"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4774 m_cdata.add_constraint ("int8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4775 m_cdata.add_constraint ("int16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4776 m_cdata.add_constraint ("int32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4777 m_cdata.add_constraint ("int64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4778 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4779 m_cdata.add_constraint ("uint16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4780 m_cdata.add_constraint ("uint32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4781 m_cdata.add_constraint ("uint64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4782 m_cdata.add_constraint ("real"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4783 m_cdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4784 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4785 m_alphadata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4786 m_alphadata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4787 m_alphadata.add_constraint (dim_vector (-1, -1)); |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4788 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4789 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4790 private: |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4791 void update_alphadata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4792 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4793 if (alphadatamapping_is ("scaled")) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4794 set_alim (m_alphadata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4795 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4796 m_alim = m_alphadata.get_limits (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4797 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4798 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4799 void update_cdata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4800 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4801 if (cdatamapping_is ("scaled")) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4802 set_clim (m_cdata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4803 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4804 m_clim = m_cdata.get_limits (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4805 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4806 if (m_xdatamode.is ("auto")) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4807 update_xdata (); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4808 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4809 if (m_ydatamode.is ("auto")) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4810 update_ydata (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4811 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4812 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4813 void update_xdata (void) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4814 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4815 if (m_xdata.get ().isempty ()) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4816 set_xdatamode ("auto"); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4817 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4818 if (m_xdatamode.is ("auto")) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4819 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4820 set_xdata (get_auto_xdata ()); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4821 set_xdatamode ("auto"); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4822 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4823 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4824 Matrix limits = m_xdata.get_limits (); |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4825 float dp = pixel_xsize (); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4826 |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4827 limits(0) = limits(0) - dp; |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4828 limits(1) = limits(1) + dp; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4829 set_xlim (limits); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4830 } |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4831 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4832 void update_ydata (void) |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4833 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4834 if (m_ydata.get ().isempty ()) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4835 set_ydatamode ("auto"); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4836 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4837 if (m_ydatamode.is ("auto")) |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4838 { |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4839 set_ydata (get_auto_ydata ()); |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4840 set_ydatamode ("auto"); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4841 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4842 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4843 Matrix limits = m_ydata.get_limits (); |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4844 float dp = pixel_ysize (); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4845 |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4846 limits(0) = limits(0) - dp; |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4847 limits(1) = limits(1) + dp; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4848 set_ylim (limits); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4849 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4850 |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4851 Matrix get_auto_xdata (void) |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4852 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4853 dim_vector dv = get_cdata ().dims (); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4854 Matrix data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4855 if (dv(1) > 0.) |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4856 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4857 data = Matrix (1, 2, 1); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4858 data(1) = dv(1); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4859 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4860 return data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4861 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4862 |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4863 Matrix get_auto_ydata (void) |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4864 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4865 dim_vector dv = get_cdata ().dims (); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4866 Matrix data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4867 if (dv(0) > 0.) |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4868 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4869 data = Matrix (1, 2, 1); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4870 data(1) = dv(0); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4871 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4872 return data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4873 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4874 |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4875 float pixel_size (octave_idx_type dim, const Matrix limits) |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4876 { |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4877 octave_idx_type l = dim - 1; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4878 float dp; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4879 |
11089
d761f0dc997e
graphics.h.in: Properly set image pixel size when unique(x/ydata) is scalar.
Ben Abbott <bpabbott@mac.com>
parents:
11076
diff
changeset
|
4880 if (l > 0 && limits(0) != limits(1)) |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4881 dp = (limits(1) - limits(0))/(2*l); |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4882 else |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4883 { |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4884 if (limits(1) == limits(2)) |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4885 dp = 0.5; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4886 else |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4887 dp = (limits(1) - limits(0))/2; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4888 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4889 return dp; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4890 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4891 |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4892 public: |
21562
6c2fd62db1f7
maint: Eliminate accidental double spaces in code.
Rik <rik@octave.org>
parents:
21367
diff
changeset
|
4893 float pixel_xsize (void) |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4894 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4895 return pixel_size ((get_cdata ().dims ())(1), m_xdata.get_limits ()); |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4896 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4897 |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4898 float pixel_ysize (void) |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4899 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4900 return pixel_size ((get_cdata ().dims ())(0), m_ydata.get_limits ()); |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4901 } |
6874 | 4902 }; |
4903 | |
4904 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4905 properties m_properties; |
6874 | 4906 |
4907 public: | |
4908 image (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4909 : base_graphics_object (), m_properties (mh, p) |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4910 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4911 m_properties.initialize_data (); |
6874 | 4912 } |
4913 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
4914 ~image (void) = default; |
6874 | 4915 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4916 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4917 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4918 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 4919 |
6874 | 4920 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4921 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4922 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4923 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4924 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4925 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4926 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4927 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4928 } |
6874 | 4929 }; |
4930 | |
4931 // --------------------------------------------------------------------- | |
4932 | |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4933 class OCTINTERP_API light : public base_graphics_object |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4934 { |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4935 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4936 |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4937 class OCTINTERP_API properties : public base_properties |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4938 { |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4939 // See the genprops.awk script for an explanation of the |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4940 // properties declarations. |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4941 // Programming note: Keep property list sorted if new ones are added. |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4942 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4943 BEGIN_PROPERTIES (light) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4944 color_property color , color_values (1, 1, 1) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4945 array_property position , default_light_position () |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4946 radio_property style , "{infinite}|local" |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4947 END_PROPERTIES |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4948 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4949 protected: |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4950 void init (void) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4951 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4952 m_position.add_constraint (dim_vector (1, 3)); |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4953 } |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
4954 |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
4955 private: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4956 OCTINTERP_API void update_visible (void); |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4957 }; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4958 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4959 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4960 properties m_properties; |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4961 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4962 public: |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4963 light (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4964 : base_graphics_object (), m_properties (mh, p) |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4965 { } |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4966 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
4967 ~light (void) = default; |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4968 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4969 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4970 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4971 const base_properties& get_properties (void) const { return m_properties; } |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4972 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4973 bool valid_object (void) const { return true; } |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4974 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4975 bool has_readonly_property (const caseless_str& pname) const |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4976 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4977 bool retval = m_properties.has_readonly_property (pname); |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4978 if (! retval) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4979 retval = base_properties::has_readonly_property (pname); |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4980 return retval; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4981 } |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
4982 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
4983 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4984 OCTINTERP_API void initialize (const graphics_object& go); |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4985 }; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4986 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4987 // --------------------------------------------------------------------- |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4988 |
7365 | 4989 class OCTINTERP_API patch : public base_graphics_object |
6874 | 4990 { |
4991 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4992 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4993 class OCTINTERP_API properties : public base_properties |
6874 | 4994 { |
4995 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4996 |
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:
7832
diff
changeset
|
4997 octave_value get_color_data (void) const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4998 |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
4999 // Matlab allows incoherent data to be stored into patch properties. |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5000 // The patch should then be ignored by the renderer. |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23401
diff
changeset
|
5001 bool has_bad_data (std::string& msg) const |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
5002 { |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5003 msg = m_bad_data_msg; |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
5004 return ! msg.empty (); |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
5005 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5006 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5007 bool is_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5008 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5009 std::string get_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5010 { return m_aliminclude.current_value (); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5011 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5012 bool is_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5013 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5014 std::string get_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5015 { return m_climinclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5016 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5017 OCTINTERP_API bool get_do_lighting (void) const; |
25423
13b1b9a0d9c5
Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents:
25418
diff
changeset
|
5018 |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5019 std::vector<std::vector<octave_idx_type>> m_coplanar_last_idx; |
25418
762eb2e33a7f
Enable support of non-coplanar faces in patches for OpenGL (bug #47677).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
25273
diff
changeset
|
5020 |
6874 | 5021 // See the genprops.awk script for an explanation of the |
5022 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5023 // Programming note: Keep property list sorted if new ones are added. |
6874 | 5024 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5025 BEGIN_PROPERTIES (patch) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5026 radio_property alphadatamapping l , "none|{scaled}|direct" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5027 double_property ambientstrength , 0.3 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5028 radio_property backfacelighting , "unlit|lit|{reverselit}" |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5029 array_property cdata u , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5030 radio_property cdatamapping l , "{scaled}|direct" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5031 double_property diffusestrength , 0.6 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5032 string_property displayname , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5033 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp")) |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5034 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp")) |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5035 radio_property edgelighting u , "{none}|flat|gouraud|phong" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5036 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp")) |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5037 color_property facecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp")) |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5038 radio_property facelighting u , "none|{flat}|gouraud|phong" |
21654
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5039 array_property facenormals m , Matrix () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5040 radio_property facenormalsmode u , "{auto}|manual" |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5041 array_property faces u , default_patch_faces () |
7848
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
5042 array_property facevertexalphadata , Matrix () |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5043 array_property facevertexcdata u , Matrix () |
7363 | 5044 radio_property linestyle , "{-}|--|:|-.|none" |
5045 double_property linewidth , 0.5 | |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5046 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram" |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
5047 color_property markeredgecolor , color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0)) |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
5048 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0)) |
7363 | 5049 double_property markersize , 6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5050 double_property specularcolorreflectance , 1.0 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5051 double_property specularexponent , 10.0 |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5052 double_property specularstrength , 0.9 |
21654
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5053 array_property vertexnormals m , Matrix () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5054 radio_property vertexnormalsmode u , "{auto}|manual" |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5055 array_property vertices u , default_patch_vertices () |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5056 array_property xdata u , default_patch_xdata () |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5057 array_property ydata u , default_patch_ydata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5058 array_property zdata u , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5059 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5060 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5061 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5062 row_vector_property clim hlr , Matrix () |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5063 row_vector_property xlim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5064 row_vector_property ylim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5065 row_vector_property zlim hlr , Matrix () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5066 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5067 bool_property climinclude hlg , "on" |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5068 bool_property xliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5069 bool_property yliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5070 bool_property zliminclude hl , "on" |
6874 | 5071 END_PROPERTIES |
5072 | |
7363 | 5073 protected: |
5074 void init (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5075 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5076 m_xdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5077 m_ydata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5078 m_zdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5079 m_faces.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5080 m_vertices.add_constraint (dim_vector (-1, 2)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5081 m_vertices.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5082 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5083 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5084 m_cdata.add_constraint ("logical"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5085 m_cdata.add_constraint ("int8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5086 m_cdata.add_constraint ("int16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5087 m_cdata.add_constraint ("int32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5088 m_cdata.add_constraint ("int64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5089 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5090 m_cdata.add_constraint ("uint16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5091 m_cdata.add_constraint ("uint32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5092 m_cdata.add_constraint ("uint64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5093 m_cdata.add_constraint ("real"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5094 m_cdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5095 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5096 m_facevertexcdata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5097 m_facevertexcdata.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5098 m_facevertexcdata.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5099 m_facevertexalphadata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5100 m_facevertexalphadata.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5101 m_facenormals.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5102 m_facenormals.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5103 m_vertexnormals.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5104 m_vertexnormals.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5105 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5106 m_ambientstrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5107 m_ambientstrength.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5108 m_diffusestrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5109 m_diffusestrength.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5110 m_linewidth.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5111 m_markersize.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5112 m_specularcolorreflectance.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5113 m_specularcolorreflectance.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5114 m_specularexponent.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5115 m_specularstrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5116 m_specularstrength.add_constraint ("max", 1.0, true); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5117 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5118 |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5119 public: |
26018
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5120 void update_normals (bool reset, bool force = false) |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5121 { |
26018
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5122 update_face_normals (reset, force); |
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5123 update_vertex_normals (reset, force); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5124 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5125 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5126 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5127 private: |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5128 std::string m_bad_data_msg; |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5129 |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5130 void update_faces (void) { update_data ();} |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5131 |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5132 void update_vertices (void) { update_data ();} |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5133 |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5134 void update_facevertexcdata (void) { update_data ();} |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5135 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5136 OCTINTERP_API void update_fvc (void); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5137 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5138 void update_xdata (void) |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5139 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
5140 if (get_xdata ().isempty ()) |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5141 { |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5142 // For compatibility with matlab behavior, |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5143 // if x/ydata are set empty, silently empty other *data and |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5144 // faces properties while vertices remain unchanged. |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5145 set_ydata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5146 set_zdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5147 set_cdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5148 set_faces (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5149 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5150 else |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5151 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5152 update_fvc (); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5153 update_normals (true); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5154 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5155 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5156 set_xlim (m_xdata.get_limits ()); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5157 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5158 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5159 void update_ydata (void) |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5160 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
5161 if (get_ydata ().isempty ()) |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5162 { |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5163 set_xdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5164 set_zdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5165 set_cdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5166 set_faces (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5167 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5168 else |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5169 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5170 update_fvc (); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5171 update_normals (true); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5172 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5173 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5174 set_ylim (m_ydata.get_limits ()); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5175 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5176 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5177 void update_zdata (void) |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5178 { |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5179 update_fvc (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5180 update_normals (true); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5181 set_zlim (m_zdata.get_limits ()); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5182 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5183 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5184 void update_cdata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5185 { |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5186 update_fvc (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5187 update_normals (false); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5188 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5189 if (cdatamapping_is ("scaled")) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5190 set_clim (m_cdata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5191 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5192 m_clim = m_cdata.get_limits (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5193 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5194 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5195 OCTINTERP_API void update_data (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5196 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5197 OCTINTERP_API void calc_face_normals (Matrix& normals); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5198 OCTINTERP_API void update_face_normals (bool reset, bool force = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5199 OCTINTERP_API void update_vertex_normals (bool reset, bool force = false); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5200 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5201 void update_edgelighting (void) |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5202 { |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5203 update_normals (false); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5204 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5205 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5206 void update_facelighting (void) |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5207 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5208 update_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5209 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5210 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5211 void update_facenormalsmode (void) |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5212 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5213 update_face_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5214 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5215 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5216 void update_vertexnormalsmode (void) |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5217 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5218 update_vertex_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5219 } |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5220 |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5221 void update_visible (void) |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5222 { |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5223 if (is_visible ()) |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5224 update_normals (false); |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5225 } |
6874 | 5226 }; |
5227 | |
5228 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5229 properties m_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5230 property_list m_default_properties; |
6874 | 5231 |
5232 public: | |
5233 patch (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5234 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
5235 { } |
6874 | 5236 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
5237 ~patch (void) = default; |
6874 | 5238 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5239 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5240 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5241 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 5242 |
6874 | 5243 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5244 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5245 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5246 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5247 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5248 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5249 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5250 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5251 } |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5252 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5253 OCTINTERP_API void reset_default_properties (void); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5254 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5255 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5256 OCTINTERP_API void initialize (const graphics_object& go); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5257 |
6874 | 5258 }; |
5259 | |
5260 // --------------------------------------------------------------------- | |
5261 | |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5262 class OCTINTERP_API scatter : public base_graphics_object |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5263 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5264 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5265 |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5266 class OCTINTERP_API properties : public base_properties |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5267 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5268 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5269 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5270 OCTINTERP_API octave_value get_color_data (void) const; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5271 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5272 // Matlab allows incoherent data to be stored in scatter properties. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5273 // The scatter object should then be ignored by the renderer. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5274 bool has_bad_data (std::string& msg) const |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5275 { |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5276 msg = m_bad_data_msg; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5277 return ! msg.empty (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5278 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5279 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5280 bool is_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5281 { return m_aliminclude.is_on (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5282 std::string get_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5283 { return m_aliminclude.current_value (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5284 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5285 bool is_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5286 { return m_climinclude.is_on (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5287 std::string get_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5288 { return m_climinclude.current_value (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5289 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5290 // See the genprops.awk script for an explanation of the |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5291 // properties declarations. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5292 // Programming note: Keep property list sorted if new ones are added. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5293 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5294 BEGIN_PROPERTIES (scatter) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5295 array_property annotation , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5296 array_property cdata mu , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5297 radio_property cdatamode u , "{auto}|manual" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5298 string_property cdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5299 array_property datatiptemplate , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5300 string_property displayname , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5301 array_property latitudedata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5302 string_property latitudedatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5303 double_property linewidth , 0.5 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5304 array_property longitudedata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5305 string_property longitudedatasource , "" |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5306 radio_property marker , "{o}|+|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram|none" |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5307 double_property markeredgealpha , 1.0 |
28414
04349a21c750
Implement "none" for scatter "markeredgecolor" property (bug #58508)
Rik <rik@octave.org>
parents:
28348
diff
changeset
|
5308 color_property markeredgecolor , color_property (radio_values ("{flat}|none"), color_values (0, 0, 0)) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5309 double_property markerfacealpha , 1.0 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5310 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0)) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5311 array_property rdata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5312 string_property rdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5313 array_property seriesindex u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5314 array_property sizedata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5315 string_property sizedatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5316 array_property thetadata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5317 string_property thetadatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5318 array_property xdata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5319 string_property xdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5320 array_property ydata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5321 string_property ydatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5322 array_property zdata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5323 string_property zdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5324 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5325 // hidden properties for limit computation |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5326 row_vector_property alim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5327 row_vector_property clim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5328 row_vector_property xlim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5329 row_vector_property ylim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5330 row_vector_property zlim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5331 bool_property aliminclude hlg , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5332 bool_property climinclude hlg , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5333 bool_property xliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5334 bool_property yliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5335 bool_property zliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5336 END_PROPERTIES |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5337 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5338 protected: |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5339 void init (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5340 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5341 m_xdata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5342 m_xdata.add_constraint (dim_vector (1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5343 m_xdata.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5344 m_xdata.add_constraint (dim_vector (0, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5345 m_ydata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5346 m_ydata.add_constraint (dim_vector (1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5347 m_ydata.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5348 m_ydata.add_constraint (dim_vector (0, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5349 m_zdata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5350 m_zdata.add_constraint (dim_vector (1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5351 m_zdata.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5352 m_zdata.add_constraint (dim_vector (0, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5353 m_sizedata.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5354 m_sizedata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5355 m_sizedata.add_constraint (dim_vector (1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5356 m_sizedata.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5357 m_sizedata.add_constraint (dim_vector (0, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5358 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5359 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5360 m_cdata.add_constraint ("logical"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5361 m_cdata.add_constraint ("int8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5362 m_cdata.add_constraint ("int16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5363 m_cdata.add_constraint ("int32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5364 m_cdata.add_constraint ("int64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5365 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5366 m_cdata.add_constraint ("uint16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5367 m_cdata.add_constraint ("uint32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5368 m_cdata.add_constraint ("uint64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5369 m_cdata.add_constraint ("real"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5370 m_cdata.add_constraint (dim_vector (-1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5371 m_cdata.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5372 m_cdata.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5373 m_cdata.add_constraint (dim_vector (0, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5374 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5375 m_linewidth.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5376 m_seriesindex.add_constraint (dim_vector (1, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5377 m_seriesindex.add_constraint (dim_vector (-1, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5378 m_seriesindex.add_constraint (dim_vector (0, -1)); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5379 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5380 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5381 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5382 OCTINTERP_API void update_color (void); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5383 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5384 private: |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5385 std::string m_bad_data_msg; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5386 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5387 void update_xdata (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5388 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5389 if (get_xdata ().isempty ()) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5390 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5391 // For compatibility with Matlab behavior, |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5392 // if x/ydata are set empty, silently empty other *data properties. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5393 set_ydata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5394 set_zdata (Matrix ()); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5395 bool cdatamode_auto = m_cdatamode.is ("auto"); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5396 set_cdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5397 if (cdatamode_auto) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5398 set_cdatamode ("auto"); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5399 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5400 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5401 set_xlim (m_xdata.get_limits ()); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5402 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5403 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5404 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5405 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5406 void update_ydata (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5407 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5408 if (get_ydata ().isempty ()) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5409 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5410 set_xdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5411 set_zdata (Matrix ()); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5412 bool cdatamode_auto = m_cdatamode.is ("auto"); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5413 set_cdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5414 if (cdatamode_auto) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5415 set_cdatamode ("auto"); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5416 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5417 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5418 set_ylim (m_ydata.get_limits ()); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5419 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5420 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5421 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5422 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5423 void update_zdata (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5424 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5425 set_zlim (m_zdata.get_limits ()); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5426 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5427 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5428 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5429 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5430 void update_sizedata (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5431 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5432 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5433 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5434 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5435 void update_cdata (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5436 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5437 if (get_cdata ().matrix_value ().rows () == 1) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5438 set_clim (m_cdata.get_limits ()); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5439 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5440 m_clim = m_cdata.get_limits (); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5441 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5442 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5443 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5444 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5445 void update_cdatamode (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5446 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5447 if (m_cdatamode.is ("auto")) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5448 update_color (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5449 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5450 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5451 void update_seriesindex (void) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5452 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5453 if (m_cdatamode.is ("auto")) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5454 update_color (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5455 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5456 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5457 void update_data (void); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5458 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5459 }; |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5460 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5461 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5462 properties m_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5463 property_list m_default_properties; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5464 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5465 public: |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5466 scatter (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5467 : base_graphics_object (), m_properties (mh, p) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5468 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5469 // FIXME: seriesindex should increment by one each time a new scatter |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5470 // object is added to the axes. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5471 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5472 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5473 ~scatter (void) = default; |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5474 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5475 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5476 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5477 const base_properties& get_properties (void) const { return m_properties; } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5478 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5479 bool valid_object (void) const { return true; } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5480 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5481 bool has_readonly_property (const caseless_str& pname) const |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5482 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5483 bool retval = m_properties.has_readonly_property (pname); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5484 if (! retval) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5485 retval = base_properties::has_readonly_property (pname); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5486 return retval; |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5487 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5488 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5489 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5490 OCTINTERP_API void initialize (const graphics_object& go); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5491 |
6874 | 5492 }; |
5493 | |
5494 // --------------------------------------------------------------------- | |
5495 | |
7365 | 5496 class OCTINTERP_API surface : public base_graphics_object |
6874 | 5497 { |
5498 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5499 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
5500 class OCTINTERP_API properties : public base_properties |
6874 | 5501 { |
5502 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5503 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5504 octave_value get_color_data (void) const; |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5505 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5506 bool is_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5507 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5508 std::string get_aliminclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5509 { return m_aliminclude.current_value (); } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5510 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5511 bool is_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5512 { return (m_climinclude.is_on () && m_cdatamapping.is ("scaled")); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5513 std::string get_climinclude (void) const |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5514 { return m_climinclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5515 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5516 OCTINTERP_API bool get_do_lighting (void) const; |
25423
13b1b9a0d9c5
Move management of lights in axes from GL to graphics backend.
Markus Mützel <markus.muetzel@gmx.de>
parents:
25418
diff
changeset
|
5517 |
6874 | 5518 // See the genprops.awk script for an explanation of the |
5519 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5520 // Programming note: Keep property list sorted if new ones are added. |
6874 | 5521 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5522 BEGIN_PROPERTIES (surface) |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5523 array_property alphadata u , Matrix (1, 1, 1.0) |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5524 radio_property alphadatamapping l , "none|direct|{scaled}" |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5525 double_property ambientstrength , 0.3 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5526 radio_property backfacelighting , "unlit|lit|{reverselit}" |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5527 array_property cdata u , default_surface_cdata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5528 radio_property cdatamapping al , "{scaled}|direct" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5529 string_property cdatasource , "" |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5530 double_property diffusestrength , 0.6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5531 string_property displayname , "" |
7846
d7737a4268b7
Fix typos in property names (edgealpha/facealpha).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7844
diff
changeset
|
5532 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp")) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5533 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp")) |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5534 radio_property edgelighting u , "{none}|flat|gouraud|phong" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5535 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp|texturemap")) |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
5536 color_property facecolor , color_property (radio_values ("none|{flat}|interp|texturemap"), color_values (0, 0, 0)) |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5537 radio_property facelighting u , "none|{flat}|gouraud|phong" |
21654
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5538 array_property facenormals m , Matrix () |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5539 radio_property facenormalsmode u , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5540 radio_property linestyle , "{-}|--|:|-.|none" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5541 double_property linewidth , 0.5 |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5542 radio_property marker , "{none}|+|o|*|.|x|||_|s|square|d|diamond|^|v|>|<|p|pentagram|h|hexagram" |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
5543 color_property markeredgecolor , color_property (radio_values ("none|{auto}|flat"), color_values (0, 0, 0)) |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
5544 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0)) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5545 double_property markersize , 6 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5546 radio_property meshstyle , "{both}|row|column" |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5547 double_property specularcolorreflectance , 1 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5548 double_property specularexponent , 10 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5549 double_property specularstrength , 0.9 |
21654
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5550 array_property vertexnormals m , Matrix () |
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5551 radio_property vertexnormalsmode u , "{auto}|manual" |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5552 array_property xdata u , default_surface_xdata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5553 string_property xdatasource , "" |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5554 array_property ydata u , default_surface_ydata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5555 string_property ydatasource , "" |
18646
2deed6538c72
Make some graphics factory defaults conform to Matlab values (bug #41770).
pantxo <pantxo.diribarne@gmail.com>
parents:
18645
diff
changeset
|
5556 array_property zdata u , default_surface_zdata () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5557 string_property zdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5558 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5559 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5560 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5561 row_vector_property clim hlr , Matrix () |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5562 row_vector_property xlim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5563 row_vector_property ylim hlr , Matrix () |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5564 row_vector_property zlim hlr , Matrix () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5565 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5566 bool_property climinclude hlg , "on" |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5567 bool_property xliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5568 bool_property yliminclude hl , "on" |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5569 bool_property zliminclude hl , "on" |
6874 | 5570 END_PROPERTIES |
5571 | |
7363 | 5572 protected: |
5573 void init (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5574 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5575 m_xdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5576 m_ydata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5577 m_zdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5578 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5579 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5580 m_cdata.add_constraint ("logical"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5581 m_cdata.add_constraint ("int8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5582 m_cdata.add_constraint ("int16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5583 m_cdata.add_constraint ("int32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5584 m_cdata.add_constraint ("int64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5585 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5586 m_cdata.add_constraint ("uint16"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5587 m_cdata.add_constraint ("uint32"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5588 m_cdata.add_constraint ("uint64"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5589 m_cdata.add_constraint ("real"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5590 m_cdata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5591 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5592 m_alphadata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5593 m_alphadata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5594 m_alphadata.add_constraint (dim_vector (-1, -1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5595 m_facenormals.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5596 m_facenormals.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5597 m_vertexnormals.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5598 m_vertexnormals.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5599 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5600 m_ambientstrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5601 m_ambientstrength.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5602 m_diffusestrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5603 m_diffusestrength.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5604 m_linewidth.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5605 m_markersize.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5606 m_specularcolorreflectance.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5607 m_specularcolorreflectance.add_constraint ("max", 1.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5608 m_specularexponent.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5609 m_specularstrength.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5610 m_specularstrength.add_constraint ("max", 1.0, true); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5611 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5612 |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5613 public: |
26018
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5614 void update_normals (bool reset, bool force = false) |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5615 { |
26018
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5616 update_face_normals (reset, force); |
50583f514ae4
Add function to manually trigger calculation of [Vertex|Face]Normals (bug #54922).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25991
diff
changeset
|
5617 update_vertex_normals (reset, force); |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5618 } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5619 |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5620 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5621 private: |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5622 void update_alphadata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5623 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5624 if (alphadatamapping_is ("scaled")) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5625 set_alim (m_alphadata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5626 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5627 m_alim = m_alphadata.get_limits (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5628 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5629 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5630 void update_cdata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5631 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5632 if (cdatamapping_is ("scaled")) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5633 set_clim (m_cdata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5634 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5635 m_clim = m_cdata.get_limits (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5636 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5637 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5638 void update_xdata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5639 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5640 update_normals (true); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5641 set_xlim (m_xdata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5642 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5643 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5644 void update_ydata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5645 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5646 update_normals (true); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5647 set_ylim (m_ydata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5648 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5649 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5650 void update_zdata (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5651 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5652 update_normals (true); |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5653 set_zlim (m_zdata.get_limits ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5654 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5655 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5656 OCTINTERP_API void update_face_normals (bool reset, bool force = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5657 OCTINTERP_API void update_vertex_normals (bool reset, bool force = false); |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5658 |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5659 void update_facenormalsmode (void) |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5660 { update_face_normals (false); } |
21654
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5661 |
a0ebc922fd52
Add "facenormals" and "*normalsmode" to "surface" and "patch" (bug #47791)
mmuetzel <markus.muetzel@gmx.de>
parents:
21568
diff
changeset
|
5662 void update_vertexnormalsmode (void) |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5663 { update_vertex_normals (false); } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5664 |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5665 void update_edgelighting (void) |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5666 { update_normals (false); } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5667 |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5668 void update_facelighting (void) |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5669 { update_normals (false); } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5670 |
26045
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5671 void update_visible (void) |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5672 { |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5673 if (is_visible ()) |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5674 update_normals (false); |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5675 } |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5676 |
6874 | 5677 }; |
5678 | |
5679 private: | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5680 properties m_properties; |
6874 | 5681 |
5682 public: | |
5683 surface (const graphics_handle& mh, const graphics_handle& p) | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5684 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
5685 { } |
6874 | 5686 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
5687 ~surface (void) = default; |
6874 | 5688 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5689 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5690 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5691 const base_properties& get_properties (void) const { return m_properties; } |
7222 | 5692 |
6874 | 5693 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5694 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5695 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5696 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5697 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5698 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5699 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5700 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5701 } |
6874 | 5702 }; |
5703 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5704 // --------------------------------------------------------------------- |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5705 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5706 class OCTINTERP_API hggroup : public base_graphics_object |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5707 { |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5708 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5709 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5710 class OCTINTERP_API properties : public base_properties |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5711 { |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5712 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5713 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5714 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5715 remove_child (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5716 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5717 OCTINTERP_API void adopt (const graphics_handle& h); |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5718 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5719 // See the genprops.awk script for an explanation of the |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5720 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5721 // Programming note: Keep property list sorted if new ones are added. |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5722 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5723 BEGIN_PROPERTIES (hggroup) |
15519
f915996325b7
Add missing DisplayName and EraseMode properties to hggroups (bug #37442)
Ben Abbott <bpabbott@mac.com>
parents:
15468
diff
changeset
|
5724 string_property displayname , "" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5725 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5726 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5727 row_vector_property alim hr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5728 row_vector_property clim hr , Matrix () |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
5729 row_vector_property xlim hr , Matrix () |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
5730 row_vector_property ylim hr , Matrix () |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
5731 row_vector_property zlim hr , Matrix () |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5732 bool_property aliminclude h , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5733 bool_property climinclude h , "on" |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5734 bool_property xliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5735 bool_property yliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5736 bool_property zliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5737 END_PROPERTIES |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5738 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5739 private: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5740 OCTINTERP_API void update_limits (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5741 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5742 OCTINTERP_API void update_limits (const graphics_handle& h) const; |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5743 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5744 protected: |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5745 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5746 { } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
5747 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5748 }; |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5749 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5750 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5751 properties m_properties; |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5752 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5753 public: |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5754 hggroup (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5755 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
5756 { } |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5757 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
5758 ~hggroup (void) = default; |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5759 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5760 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5761 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5762 const base_properties& get_properties (void) const { return m_properties; } |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5763 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5764 bool valid_object (void) const { return true; } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
5765 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5766 OCTINTERP_API void update_axis_limits (const std::string& axis_type); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5767 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5768 OCTINTERP_API void update_axis_limits (const std::string& axis_type, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5769 const graphics_handle& h); |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
5770 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5771 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5772 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5773 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5774 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5775 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5776 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5777 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5778 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5779 }; |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5780 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5781 // --------------------------------------------------------------------- |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5782 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5783 class OCTINTERP_API uimenu : public base_graphics_object |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5784 { |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5785 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5786 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5787 class OCTINTERP_API properties : public base_properties |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5788 { |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5789 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5790 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
5791 void remove_child (const graphics_handle& h, bool from_root = false) |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5792 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5793 base_properties::remove_child (h, from_root); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5794 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5795 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5796 void adopt (const graphics_handle& h) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5797 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5798 base_properties::adopt (h); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5799 } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5800 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5801 // See the genprops.awk script for an explanation of the |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5802 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5803 // Programming note: Keep property list sorted if new ones are added. |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5804 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5805 BEGIN_PROPERTIES (uimenu) |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5806 string_property accelerator , "" |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5807 // Deprecated in R2017b (replaced by "MenuSelectedFcn") |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5808 callback_property callback hgs , Matrix () |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5809 bool_property checked , "off" |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5810 bool_property enable , "on" |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5811 color_property foregroundcolor , color_values (0, 0, 0) |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5812 // Deprecated in R2017b (replaced by "Text") |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5813 string_property label hgs , "" |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5814 callback_property menuselectedfcn , Matrix () |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5815 // Deprecated in R2017b, but replacement of re-ordering "children" |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5816 // property of parent does not work yet in Octave. |
20045
ae12edf69bce
Set default uimenu position property to 0 (Bug #44770)
John Donoghue
parents:
19987
diff
changeset
|
5817 double_property position , 0 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5818 bool_property separator , "off" |
29913
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5819 string_property text , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5820 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5821 // Octave-specific properties |
22622
4191f8b5070c
Add '__' to start/end of hidden Octave-only graphics properties (bug #49205).
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
5822 string_property __fltk_label__ h , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5823 any_property __object__ h , Matrix () |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5824 END_PROPERTIES |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5825 |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5826 // Make "Label" an alias for "Text". |
29913
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5827 std::string get_label (void) const |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5828 { |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5829 return get_text (); |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5830 } |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5831 |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5832 void set_label (const octave_value& val) |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5833 { |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5834 set_text (val); |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5835 } |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5836 |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5837 // Make "Callback" an alias for "MenuSelectedFcn". |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5838 octave_value get_callback (void) const |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5839 { |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5840 return get_menuselectedfcn (); |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5841 } |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5842 |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5843 void set_callback (const octave_value& val) |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5844 { |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5845 set_menuselectedfcn (val); |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5846 } |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5847 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5848 protected: |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5849 void init (void) |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
5850 { |
30993
63710f3bd981
Stop incorrect error when reset() called on uimenu handle (bug #62425)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
5851 m_position.add_constraint ("min", 0, true); |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
5852 } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5853 }; |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5854 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5855 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5856 properties m_properties; |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5857 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5858 public: |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5859 uimenu (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5860 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
5861 { } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5862 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
5863 ~uimenu (void) = default; |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5864 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5865 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5866 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5867 const base_properties& get_properties (void) const { return m_properties; } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5868 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5869 bool valid_object (void) const { return true; } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5870 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5871 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5872 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5873 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5874 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5875 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5876 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5877 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5878 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5879 }; |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5880 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5881 // --------------------------------------------------------------------- |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5882 |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
5883 // FIXME: This class has been renamed to "contextmenu" in Matlab R2020a. |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5884 class OCTINTERP_API uicontextmenu : public base_graphics_object |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5885 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5886 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5887 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5888 class OCTINTERP_API properties : public base_properties |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5889 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5890 public: |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5891 |
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5892 void add_dependent_obj (graphics_handle gh) |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5893 { m_dependent_obj_list.push_back (gh); } |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5894 |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5895 // FIXME: the list may contain duplicates. |
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5896 // Should we return only unique elements? |
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5897 const std::list<graphics_handle> get_dependent_obj_list (void) |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5898 { return m_dependent_obj_list; } |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5899 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5900 // See the genprops.awk script for an explanation of the |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5901 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5902 // Programming note: Keep property list sorted if new ones are added. |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5903 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5904 BEGIN_PROPERTIES (uicontextmenu) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
5905 callback_property callback , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5906 array_property position , Matrix (1, 2, 0.0) |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5907 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5908 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5909 any_property __object__ h , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5910 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5911 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5912 protected: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5913 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5914 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5915 m_position.add_constraint (dim_vector (1, 2)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5916 m_position.add_constraint (dim_vector (2, 1)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5917 m_visible.set (octave_value (false)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5918 } |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5919 |
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5920 private: |
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5921 // List of objects that might depend on this uicontextmenu object |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5922 std::list<graphics_handle> m_dependent_obj_list; |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
5923 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5924 OCTINTERP_API void update_beingdeleted (void); |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
5925 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5926 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5927 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5928 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5929 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5930 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5931 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5932 uicontextmenu (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5933 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
5934 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5935 |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
5936 ~uicontextmenu (void) = default; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5937 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5938 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5939 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5940 const base_properties& get_properties (void) const { return m_properties; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5941 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5942 bool valid_object (void) const { return true; } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5943 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5944 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5945 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5946 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5947 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5948 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5949 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5950 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5951 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5952 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5953 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5954 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5955 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5956 class OCTINTERP_API uicontrol : public base_graphics_object |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5957 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5958 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5959 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5960 class OCTINTERP_API properties : public base_properties |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5961 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5962 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5963 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5964 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5965 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5966 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5967 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5968 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5969 get___fontsize_points__ (double box_pix_height = 0) const; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5970 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5971 // See the genprops.awk script for an explanation of the |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5972 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5973 // Programming note: Keep property list sorted if new ones are added. |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5974 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5975 BEGIN_PROPERTIES (uicontrol) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
5976 color_property backgroundcolor , color_values (0.94, 0.94, 0.94) |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5977 callback_property callback , Matrix () |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5978 array_property cdata , Matrix () |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5979 bool_property clipping , "on" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5980 radio_property enable , "{on}|inactive|off" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5981 array_property extent rG , Matrix (1, 4, 0.0) |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
5982 radio_property fontangle u , "{normal}|italic" |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5983 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5984 double_property fontsize u , 10 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5985 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
5986 radio_property fontweight u , "{normal}|bold" |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5987 color_property foregroundcolor , color_values (0, 0, 0) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5988 radio_property horizontalalignment , "left|{center}|right" |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5989 callback_property keypressfcn , Matrix () |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5990 double_property listboxtop , 1 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5991 double_property max , 1 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5992 double_property min , 0 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5993 array_property position , default_control_position () |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5994 array_property sliderstep , default_control_sliderstep () |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5995 string_array_property string u , "" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5996 radio_property style S , "{pushbutton}|togglebutton|radiobutton|checkbox|edit|text|slider|frame|listbox|popupmenu" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5997 string_property tooltipstring , "" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
5998 radio_property units u , "normalized|inches|centimeters|points|{pixels}|characters" |
22619
7adc5bbd840a
graphics: set uicontrol value default to 0 and handle special cases (Bug #48255)
John D
parents:
22407
diff
changeset
|
5999 row_vector_property value , Matrix (1, 1, 0.0) |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6000 radio_property verticalalignment , "top|{middle}|bottom" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6001 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6002 // Octave-specific properties |
26037
864448a7f347
Don't set keyboard focus on newly created uicontrol objects (bug #54942)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26024
diff
changeset
|
6003 bool_property __focus__ h , "off" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6004 any_property __object__ h , Matrix () |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6005 END_PROPERTIES |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6006 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6007 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6008 std::string m_cached_units; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6009 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6010 protected: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6011 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6012 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6013 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6014 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6015 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6016 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6017 m_cdata.add_constraint (dim_vector (0, 0)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6018 m_position.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6019 m_sliderstep.add_constraint (dim_vector (1, 2)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6020 m_fontsize.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6021 m_cached_units = get_units (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6022 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6023 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6024 OCTINTERP_API void update_text_extent (void); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6025 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6026 void update_string (void) { update_text_extent (); } |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6027 void update_fontname (void) { update_text_extent (); } |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6028 void update_fontsize (void) { update_text_extent (); } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6029 void update_fontangle (void) |
23396
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
6030 { |
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
6031 update_text_extent (); |
23210
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
6032 } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6033 void update_fontweight (void) { update_text_extent (); } |
23210
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
6034 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6035 OCTINTERP_API void update_fontunits (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6036 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6037 OCTINTERP_API void update_units (void); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6038 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6039 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6040 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6041 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6042 properties m_properties; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6043 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6044 public: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6045 uicontrol (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6046 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
6047 { } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6048 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6049 ~uicontrol (void) = default; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6050 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6051 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6052 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6053 const base_properties& get_properties (void) const { return m_properties; } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6054 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6055 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6056 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6057 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6058 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6059 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6060 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6061 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6062 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6063 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6064 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6065 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6066 // --------------------------------------------------------------------- |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6067 |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6068 class OCTINTERP_API uibuttongroup : public base_graphics_object |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6069 { |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6070 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6071 |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6072 class OCTINTERP_API properties : public base_properties |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6073 { |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6074 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6075 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6076 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6077 remove_child (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6078 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6079 OCTINTERP_API void adopt (const graphics_handle& h); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6080 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6081 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6082 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6083 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6084 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6085 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6086 get___fontsize_points__ (double box_pix_height = 0) const; |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6087 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6088 // See the genprops.awk script for an explanation of the |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6089 // properties declarations. |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6090 // Programming note: Keep property list sorted if new ones are added. |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6091 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6092 BEGIN_PROPERTIES (uibuttongroup) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
6093 color_property backgroundcolor , color_values (0.94, 0.94, 0.94) |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6094 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|line" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6095 double_property borderwidth , 1 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6096 bool_property clipping , "on" |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
6097 radio_property fontangle , "{normal}|italic" |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6098 string_property fontname , OCTAVE_DEFAULT_FONTNAME |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6099 double_property fontsize , 10 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6100 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6101 radio_property fontweight , "{normal}|bold" |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6102 color_property foregroundcolor , color_values (0, 0, 0) |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6103 color_property highlightcolor , color_values (1, 1, 1) |
26194
4f1b3651fa5f
Implement "SizeChangedFcn" for uipanel and uibuttongroup (bug #55085).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26185
diff
changeset
|
6104 array_property position S , default_panel_position () |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6105 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6106 // and has been replaced with "sizechangedfcn" |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6107 // Eventually this will need to be hidden, and then removed. |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6108 callback_property resizefcn , Matrix () |
24120
0d446e938f1f
maint: clean up code formatting in generated graphics.h
Mike Miller <mtmiller@octave.org>
parents:
24071
diff
changeset
|
6109 handle_property selectedobject S , graphics_handle () |
0d446e938f1f
maint: clean up code formatting in generated graphics.h
Mike Miller <mtmiller@octave.org>
parents:
24071
diff
changeset
|
6110 callback_property selectionchangedfcn , Matrix () |
25449
d2d9701d2dcb
Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents:
25436
diff
changeset
|
6111 color_property shadowcolor , color_values (0.7, 0.7, 0.7) |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6112 callback_property sizechangedfcn , Matrix () |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6113 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6114 string_property title , "" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6115 radio_property titleposition , "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6116 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6117 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6118 any_property __object__ h , Matrix () |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6119 END_PROPERTIES |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6120 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6121 protected: |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6122 void init (void) |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6123 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6124 m_position.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6125 m_borderwidth.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6126 m_fontsize.add_constraint ("min", 0.0, false); |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6127 } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6128 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6129 // void update_text_extent (void); |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6130 // void update_string (void) { update_text_extent (); } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6131 // void update_fontname (void) { update_text_extent (); } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6132 // void update_fontsize (void) { update_text_extent (); } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6133 // void update_fontangle (void) { update_text_extent (); } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6134 // void update_fontweight (void) { update_fontweight (); } |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6135 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6136 OCTINTERP_API void update_units (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6137 OCTINTERP_API void update_fontunits (const caseless_str& old_units); |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6138 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6139 }; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6140 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6141 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6142 properties m_properties; |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6143 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6144 public: |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6145 uibuttongroup (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6146 : base_graphics_object (), m_properties (mh, p) |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6147 { } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6148 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6149 ~uibuttongroup (void) = default; |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6150 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6151 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6152 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6153 const base_properties& get_properties (void) const { return m_properties; } |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6154 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6155 bool valid_object (void) const { return true; } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6156 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6157 bool has_readonly_property (const caseless_str& pname) const |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6158 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6159 bool retval = m_properties.has_readonly_property (pname); |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6160 if (! retval) |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6161 retval = base_properties::has_readonly_property (pname); |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6162 return retval; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6163 } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6164 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6165 }; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6166 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6167 // --------------------------------------------------------------------- |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6168 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6169 class OCTINTERP_API uipanel : public base_graphics_object |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6170 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6171 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6172 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6173 class OCTINTERP_API properties : public base_properties |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6174 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6175 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6176 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6177 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6178 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6179 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6180 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6181 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6182 get___fontsize_points__ (double box_pix_height = 0) const; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6183 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6184 // See the genprops.awk script for an explanation of the |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6185 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6186 // Programming note: Keep property list sorted if new ones are added. |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6187 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6188 BEGIN_PROPERTIES (uipanel) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
6189 color_property backgroundcolor , color_values (0.94, 0.94, 0.94) |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6190 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|line" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6191 double_property borderwidth , 1 |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
6192 radio_property fontangle , "{normal}|italic" |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6193 string_property fontname , OCTAVE_DEFAULT_FONTNAME |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6194 double_property fontsize , 10 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6195 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6196 radio_property fontweight , "{normal}|bold" |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6197 color_property foregroundcolor , color_values (0, 0, 0) |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6198 color_property highlightcolor , color_values (1, 1, 1) |
26194
4f1b3651fa5f
Implement "SizeChangedFcn" for uipanel and uibuttongroup (bug #55085).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26185
diff
changeset
|
6199 array_property position S , default_panel_position () |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6200 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6201 // and has been replaced with "sizechangedfcn" |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6202 // Eventually this will need to be hidden, and then removed. |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6203 callback_property resizefcn , Matrix () |
25449
d2d9701d2dcb
Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents:
25436
diff
changeset
|
6204 color_property shadowcolor , color_values (0.7, 0.7, 0.7) |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6205 callback_property sizechangedfcn , Matrix () |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6206 string_property title , "" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6207 radio_property titleposition , "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom" |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6208 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6209 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6210 any_property __object__ h , Matrix () |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6211 END_PROPERTIES |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6212 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6213 protected: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6214 void init (void) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
6215 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6216 m_borderwidth.add_constraint ("min", 0.0, true); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6217 m_fontsize.add_constraint ("min", 0.0, false); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6218 m_position.add_constraint (dim_vector (1, 4)); |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
6219 } |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18819
diff
changeset
|
6220 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6221 OCTINTERP_API void update_units (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6222 OCTINTERP_API void update_fontunits (const caseless_str& old_units); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6223 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6224 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6225 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6226 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6227 properties m_properties; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6228 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6229 public: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6230 uipanel (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6231 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
6232 { } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6233 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6234 ~uipanel (void) = default; |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6235 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6236 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6237 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6238 const base_properties& get_properties (void) const { return m_properties; } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6239 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6240 bool valid_object (void) const { return true; } |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6241 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6242 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6243 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6244 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6245 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6246 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6247 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6248 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6249 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6250 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6251 // --------------------------------------------------------------------- |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6252 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6253 class OCTINTERP_API uitable : public base_graphics_object |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6254 { |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6255 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6256 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6257 class OCTINTERP_API properties : public base_properties |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6258 { |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6259 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6260 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6261 OCTINTERP_API Matrix |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6262 get_boundingbox (bool internal = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6263 const Matrix& parent_pix_size = Matrix ()) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6264 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6265 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6266 get___fontsize_points__ (double box_pix_height = 0) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6267 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6268 OCTINTERP_API double |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6269 get_fontsize_pixels (double box_pix_height = 0) const; |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6270 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6271 // See the genprops.awk script for an explanation of the |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6272 // properties declarations. |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6273 // Programming note: Keep property list sorted if new ones are added. |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6274 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6275 // FIXME: keypressfcn, keyreleasefcn, rearrangeablecolumns properties |
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6276 // seem to have been removed from Matlab. |
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6277 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6278 BEGIN_PROPERTIES (uitable) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6279 any_property __object__ h , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6280 array_property backgroundcolor , default_table_backgroundcolor () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6281 callback_property celleditcallback , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6282 callback_property cellselectioncallback , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6283 row_vector_property columneditable , Matrix () |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6284 any_property columnformat S , Cell () |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6285 any_property columnname , "numbered" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6286 any_property columnwidth S , "auto" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6287 any_property data u , Matrix () |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6288 bool_property enable , "on" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6289 array_property extent rG , Matrix (1, 4, 0.0) |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
6290 radio_property fontangle u , "{normal}|italic" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6291 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6292 double_property fontsize u , 10 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6293 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6294 radio_property fontweight u , "{normal}|bold" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6295 color_property foregroundcolor , color_values (0, 0, 0) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6296 callback_property keypressfcn , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6297 callback_property keyreleasefcn , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6298 array_property position , default_table_position () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6299 bool_property rearrangeablecolumns , "off" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6300 any_property rowname , "numbered" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6301 bool_property rowstriping , "on" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6302 string_property tooltipstring , "" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6303 radio_property units S , "normalized|inches|centimeters|points|{pixels}|characters" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6304 END_PROPERTIES |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6305 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6306 OCTINTERP_API Matrix get_extent_matrix (void) const; |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6307 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6308 OCTINTERP_API Matrix get_backgroundcolor_rgb (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6309 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6310 OCTINTERP_API Matrix get_alternatebackgroundcolor_rgb (void); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6311 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6312 protected: |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6313 void init (void) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6314 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6315 m_position.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6316 m_extent.add_constraint (dim_vector (1, 4)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6317 m_backgroundcolor.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6318 m_backgroundcolor.add_constraint (dim_vector (-1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6319 m_columneditable.add_constraint ("logical"); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6320 } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6321 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6322 OCTINTERP_API void update_units (const caseless_str& old_units); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6323 OCTINTERP_API void update_fontunits (const caseless_str& old_units); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6324 void update_table_extent (void) { }; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6325 void update_data (void) { update_table_extent (); } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6326 void update_fontname (void) { update_table_extent (); } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6327 void update_fontsize (void) { update_table_extent (); } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6328 void update_fontangle (void) |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6329 { |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6330 update_table_extent (); |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6331 } |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6332 void update_fontweight (void) { update_table_extent (); } |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6333 }; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6334 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6335 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6336 properties m_properties; |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6337 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6338 public: |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6339 uitable (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6340 : base_graphics_object (), m_properties (mh, p) |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6341 { } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6342 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6343 ~uitable (void) { } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6344 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6345 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6346 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6347 const base_properties& get_properties (void) const { return m_properties; } |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6348 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6349 bool valid_object (void) const { return true; } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6350 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6351 bool has_readonly_property (const caseless_str& pname) const |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6352 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6353 bool retval = m_properties.has_readonly_property (pname); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6354 if (! retval) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6355 retval = base_properties::has_readonly_property (pname); |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6356 return retval; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6357 } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6358 }; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6359 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6360 // --------------------------------------------------------------------- |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6361 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6362 class OCTINTERP_API uitoolbar : public base_graphics_object |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6363 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6364 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6365 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6366 class OCTINTERP_API properties : public base_properties |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6367 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6368 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6369 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6370 // See the genprops.awk script for an explanation of the |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6371 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6372 // Programming note: Keep property list sorted if new ones are added. |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6373 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6374 BEGIN_PROPERTIES (uitoolbar) |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6375 // Octave-specific properties |
20593
3af34e1ef330
Preliminary inclusion of uixx objects properties in the manual (bug #46076)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20545
diff
changeset
|
6376 any_property __object__ h , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6377 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6378 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6379 protected: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6380 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6381 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6382 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6383 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6384 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6385 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6386 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6387 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6388 uitoolbar (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6389 : base_graphics_object (), m_properties (mh, p), m_default_properties () |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
6390 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6391 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6392 ~uitoolbar (void) = default; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6393 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6394 void override_defaults (base_graphics_object& obj) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6395 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6396 // Allow parent (figure) to override first (properties knows how |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6397 // to find the parent object). |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6398 m_properties.override_defaults (obj); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6399 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6400 // Now override with our defaults. If the default_properties |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6401 // list includes the properties for all defaults (line, |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6402 // surface, etc.) then we don't have to know the type of OBJ |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6403 // here, we just call its set function and let it decide which |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6404 // properties from the list to use. |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6405 obj.set_from_list (m_default_properties); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6406 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6407 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6408 void set (const caseless_str& name, const octave_value& value) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6409 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6410 if (name.compare ("default", 7)) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6411 // strip "default", pass rest to function that will |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6412 // parse the remainder and add the element to the |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6413 // default_properties map. |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6414 m_default_properties.set (name.substr (7), value); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6415 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6416 m_properties.set (name, value); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6417 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6418 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6419 octave_value get (const caseless_str& name) const |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6420 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6421 octave_value retval; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6422 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6423 if (name.compare ("default", 7)) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6424 retval = get_default (name.substr (7)); |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6425 else |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6426 retval = m_properties.get (name); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6427 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6428 return retval; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6429 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6430 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6431 OCTINTERP_API octave_value get_default (const caseless_str& name) const; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6432 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6433 octave_value get_defaults (void) const |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6434 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6435 return m_default_properties.as_struct ("default"); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6436 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6437 |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
6438 property_list get_defaults_list (void) const |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
6439 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6440 return m_default_properties; |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6441 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6442 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6443 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6444 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6445 const base_properties& get_properties (void) const { return m_properties; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6446 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6447 bool valid_object (void) const { return true; } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6448 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6449 OCTINTERP_API void reset_default_properties (void); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6450 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6451 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6452 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6453 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6454 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6455 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6456 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6457 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6458 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6459 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6460 property_list m_default_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6461 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6462 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6463 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6464 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6465 class OCTINTERP_API uipushtool : public base_graphics_object |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6466 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6467 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6468 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6469 class OCTINTERP_API properties : public base_properties |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6470 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6471 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6472 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6473 // See the genprops.awk script for an explanation of the |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6474 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6475 // Programming note: Keep property list sorted if new ones are added. |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6476 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6477 BEGIN_PROPERTIES (uipushtool) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6478 array_property cdata , Matrix () |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
6479 callback_property clickedcallback , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6480 bool_property enable , "on" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6481 bool_property separator , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6482 string_property tooltipstring , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6483 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6484 // Octave-specific properties |
26869
992f55ef87f5
Use an uitoolbar and ui*tools to build the default figure toolbar (bug #55795)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26858
diff
changeset
|
6485 string_property __named_icon__ , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6486 any_property __object__ h , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6487 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6488 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6489 protected: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6490 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6491 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6492 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6493 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6494 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6495 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6496 m_cdata.add_constraint (dim_vector (0, 0)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6497 } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6498 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6499 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6500 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6501 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6502 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6503 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6504 uipushtool (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6505 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
6506 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6507 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6508 ~uipushtool (void) = default; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6509 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6510 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6511 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6512 const base_properties& get_properties (void) const { return m_properties; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6513 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6514 bool valid_object (void) const { return true; } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6515 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6516 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6517 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6518 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6519 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6520 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6521 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6522 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6523 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6524 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6525 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6526 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6527 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6528 class OCTINTERP_API uitoggletool : public base_graphics_object |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6529 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6530 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6531 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6532 class OCTINTERP_API properties : public base_properties |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6533 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6534 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6535 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6536 // See the genprops.awk script for an explanation of the |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6537 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6538 // Programming note: Keep property list sorted if new ones are added. |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6539 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6540 BEGIN_PROPERTIES (uitoggletool) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6541 array_property cdata , Matrix () |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
6542 callback_property clickedcallback , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6543 bool_property enable , "on" |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
6544 callback_property offcallback , Matrix () |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14563
diff
changeset
|
6545 callback_property oncallback , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6546 bool_property separator , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6547 bool_property state , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6548 string_property tooltipstring , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6549 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6550 // Octave-specific properties |
26869
992f55ef87f5
Use an uitoolbar and ui*tools to build the default figure toolbar (bug #55795)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26858
diff
changeset
|
6551 string_property __named_icon__ , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6552 any_property __object__ h , Matrix () |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6553 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6554 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6555 protected: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6556 void init (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6557 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6558 m_cdata.add_constraint ("double"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6559 m_cdata.add_constraint ("single"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6560 m_cdata.add_constraint ("uint8"); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6561 m_cdata.add_constraint (dim_vector (-1, -1, 3)); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6562 m_cdata.add_constraint (dim_vector (0, 0)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6563 } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6564 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6565 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6566 private: |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6567 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6568 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6569 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6570 uitoggletool (const graphics_handle& mh, const graphics_handle& p) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6571 : base_graphics_object (), m_properties (mh, p) |
20051
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
6572 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6573 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6574 ~uitoggletool (void) = default; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6575 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6576 base_properties& get_properties (void) { return m_properties; } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6577 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6578 const base_properties& get_properties (void) const { return m_properties; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6579 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6580 bool valid_object (void) const { return true; } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6581 |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6582 bool has_readonly_property (const caseless_str& pname) const |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6583 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6584 bool retval = m_properties.has_readonly_property (pname); |
18567
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6585 if (! retval) |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6586 retval = base_properties::has_readonly_property (pname); |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6587 return retval; |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6588 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6589 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6590 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6591 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6592 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6593 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6594 OCTINTERP_API octave_value |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
6595 get_property_from_handle (double handle, const std::string& property, |
30896
c9788d7f6e65
maint: Use "fcn" as preferred abbreviation for "function" in libinterp/.
Rik <rik@octave.org>
parents:
30659
diff
changeset
|
6596 const std::string& fcn); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6597 OCTINTERP_API bool |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
6598 set_property_in_handle (double handle, const std::string& property, |
30896
c9788d7f6e65
maint: Use "fcn" as preferred abbreviation for "function" in libinterp/.
Rik <rik@octave.org>
parents:
30659
diff
changeset
|
6599 const octave_value& arg, const std::string& fcn); |
6874 | 6600 |
6601 // --------------------------------------------------------------------- | |
6602 | |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6603 class graphics_event; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6604 |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6605 class |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6606 OCTINTERP_API |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6607 base_graphics_event |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6608 { |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6609 public: |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6610 enum priority { INTERRUPT, QUEUE, CANCEL }; |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6611 |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6612 friend class graphics_event; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6613 |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6614 base_graphics_event (void) |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6615 : m_busyaction (QUEUE) |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6616 { }; |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6617 |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6618 base_graphics_event (int busyaction) |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6619 : m_busyaction (busyaction) |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6620 { }; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6621 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
6622 virtual ~base_graphics_event (void) = default; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6623 |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6624 int get_busyaction (void) { return m_busyaction; }; |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6625 |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6626 virtual void execute (void) = 0; |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6627 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
6628 private: |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6629 int m_busyaction; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6630 }; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6631 |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6632 class |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6633 OCTINTERP_API |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6634 graphics_event |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6635 { |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6636 public: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6637 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
6638 typedef void (*event_fcn) (void *); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6639 |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6640 graphics_event (void) = default; |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6641 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6642 graphics_event (base_graphics_event *new_rep) : m_rep (new_rep) { } |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6643 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
6644 graphics_event (const graphics_event&) = default; |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6645 |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6646 ~graphics_event (void) = default; |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6647 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
6648 graphics_event& operator = (const graphics_event&) = default; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6649 |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6650 int get_busyaction (void) |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6651 { |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6652 if (ok ()) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6653 return m_rep->get_busyaction (); |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6654 else |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6655 error ("graphics_event::busyaction: invalid graphics_event"); |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6656 } |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6657 |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6658 void execute (void) |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6659 { |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6660 if (ok ()) |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6661 m_rep->execute (); |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6662 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6663 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6664 bool ok (void) const { return (m_rep != nullptr); } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6665 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6666 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6667 create_callback_event (const graphics_handle& h, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6668 const std::string& name, |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6669 const octave_value& data = Matrix (), |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6670 int busyaction = base_graphics_event::QUEUE); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6671 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6672 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6673 create_callback_event (const graphics_handle& h, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6674 const octave_value& cb, |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6675 const octave_value& data = Matrix (), |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6676 int busyaction = base_graphics_event::QUEUE); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6677 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6678 static OCTINTERP_API graphics_event |
26520
278ae90567a7
Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26469
diff
changeset
|
6679 create_mcode_event (const graphics_handle& h, const std::string& cmd, |
278ae90567a7
Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26469
diff
changeset
|
6680 int busyaction); |
278ae90567a7
Don't use C++ callback to notify close request from Qt Figures (bug #54187)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26469
diff
changeset
|
6681 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6682 static OCTINTERP_API graphics_event |
23457
21baad6b35c4
maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents:
23450
diff
changeset
|
6683 create_function_event (event_fcn fcn, void *data = nullptr); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6684 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6685 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6686 create_set_event (const graphics_handle& h, const std::string& name, |
26469
bf835b1d04b1
Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26383
diff
changeset
|
6687 const octave_value& value, bool notify_toolkit = true, |
bf835b1d04b1
Don't use C++ callbacks to notify position changes from Qt figures (bug #48519)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26383
diff
changeset
|
6688 bool redraw_figure = false); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6689 private: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6690 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6691 std::shared_ptr <base_graphics_event> m_rep; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6692 }; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6693 |
7365 | 6694 class OCTINTERP_API gh_manager |
6874 | 6695 { |
6696 public: | |
6697 | |
30299
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6698 typedef std::pair<uint8NDArray /*pixels*/, std::string /*svg*/> latex_data; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6699 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6700 OCTINTERP_API gh_manager (octave::interpreter& interp); |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6701 |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6702 // FIXME: eventually eliminate these static functions and access |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6703 // gh_manager object through the interpreter. |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6704 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6705 OCTINTERP_API graphics_handle get_handle (bool integer_figure_handle); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6706 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6707 OCTINTERP_API void free (const graphics_handle& h, bool from_root = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6708 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6709 OCTINTERP_API void renumber_figure (const graphics_handle& old_gh, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6710 const graphics_handle& new_gh); |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6711 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6712 graphics_handle lookup (double val) const |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6713 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6714 const_iterator p = (octave::math::isnan (val) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6715 ? m_handle_map.end () : m_handle_map.find (val)); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6716 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6717 return (p != m_handle_map.end ()) ? p->first : graphics_handle (); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6718 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6719 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6720 graphics_handle lookup (const octave_value& val) const |
10265
8c583af2cf64
validate text object children of axes objects
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
6721 { |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6722 return (val.is_real_scalar () |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6723 ? lookup (val.double_value ()) : graphics_handle ()); |
10265
8c583af2cf64
validate text object children of axes objects
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
6724 } |
8c583af2cf64
validate text object children of axes objects
John W. Eaton <jwe@octave.org>
parents:
10161
diff
changeset
|
6725 |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6726 graphics_object get_object (double val) const |
12324
85934e0fcce9
gl-renderer.cc and gl2ps-renderer.cc: access objects directly from gh_manager instead of working with handles
John W. Eaton <jwe@octave.org>
parents:
12174
diff
changeset
|
6727 { |
85934e0fcce9
gl-renderer.cc and gl2ps-renderer.cc: access objects directly from gh_manager instead of working with handles
John W. Eaton <jwe@octave.org>
parents:
12174
diff
changeset
|
6728 return get_object (lookup (val)); |
85934e0fcce9
gl-renderer.cc and gl2ps-renderer.cc: access objects directly from gh_manager instead of working with handles
John W. Eaton <jwe@octave.org>
parents:
12174
diff
changeset
|
6729 } |
85934e0fcce9
gl-renderer.cc and gl2ps-renderer.cc: access objects directly from gh_manager instead of working with handles
John W. Eaton <jwe@octave.org>
parents:
12174
diff
changeset
|
6730 |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6731 graphics_object get_object (const graphics_handle& h) const |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6732 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6733 const_iterator p = (h.ok () ? m_handle_map.find (h) : m_handle_map.end ()); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6734 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6735 return (p != m_handle_map.end ()) ? p->second : graphics_object (); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6736 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6737 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6738 OCTINTERP_API graphics_handle |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6739 make_graphics_handle (const std::string& go_name, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6740 const graphics_handle& p, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6741 bool integer_figure_handle = false, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6742 bool call_createfcn = true, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6743 bool notify_toolkit = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6744 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6745 OCTINTERP_API graphics_handle |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6746 make_figure_handle (double val, bool notify_toolkit = true); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6747 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6748 OCTINTERP_API void push_figure (const graphics_handle& h); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6749 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6750 OCTINTERP_API void pop_figure (const graphics_handle& h); |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6751 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6752 graphics_handle current_figure (void) const |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6753 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6754 graphics_handle retval; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6755 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6756 for (const auto& hfig : m_figure_list) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6757 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6758 if (is_handle_visible (hfig)) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6759 retval = hfig; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6760 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6761 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6762 return retval; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6763 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6764 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6765 Matrix handle_list (bool show_hidden = false) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6766 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6767 Matrix retval (1, m_handle_map.size ()); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6768 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6769 octave_idx_type i = 0; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6770 for (const auto& h_iter : m_handle_map) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6771 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6772 graphics_handle h = h_iter.first; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6773 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6774 if (show_hidden || is_handle_visible (h)) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6775 retval(i++) = h.value (); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6776 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6777 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6778 retval.resize (1, i); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6779 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6780 return retval; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6781 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6782 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6783 void lock (void) { m_graphics_lock.lock (); } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6784 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6785 bool try_lock (void) { return m_graphics_lock.try_lock (); } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6786 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6787 void unlock (void) { m_graphics_lock.unlock (); } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6788 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6789 Matrix figure_handle_list (bool show_hidden = false) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6790 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6791 Matrix retval (1, m_figure_list.size ()); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6792 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6793 octave_idx_type i = 0; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6794 for (const auto& hfig : m_figure_list) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6795 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6796 if (show_hidden || is_handle_visible (hfig)) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6797 retval(i++) = hfig.value (); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6798 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6799 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6800 retval.resize (1, i); |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6801 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6802 return retval; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6803 } |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6804 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6805 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6806 execute_listener (const graphics_handle& h, const octave_value& l); |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6807 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6808 void execute_callback (const graphics_handle& h, |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6809 const std::string& name, |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6810 const octave_value& data = Matrix ()) |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6811 { |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6812 octave_value cb; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6813 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6814 if (true) |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6815 { |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6816 octave::autolock guard (graphics_lock ()); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6817 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6818 graphics_object go = get_object (h); |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6819 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6820 if (go.valid_object ()) |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6821 cb = go.get (name); |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6822 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6823 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
6824 execute_callback (h, cb, data); |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6825 } |
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6826 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6827 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6828 execute_callback (const graphics_handle& h, const octave_value& cb, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6829 const octave_value& data = Matrix ()); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6830 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6831 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6832 post_callback (const graphics_handle& h, const std::string& name, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6833 const octave_value& data = Matrix ()); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6834 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6835 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6836 post_function (graphics_event::event_fcn fcn, void *fcn_data = nullptr); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6837 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6838 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6839 post_set (const graphics_handle& h, const std::string& name, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6840 const octave_value& value, bool notify_toolkit = true, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6841 bool redraw_figure = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6842 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6843 OCTINTERP_API int process_events (bool force = false); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6844 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6845 OCTINTERP_API void enable_event_processing (bool enable = true); |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6846 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6847 bool is_handle_visible (const graphics_handle& h) const |
8249 | 6848 { |
6849 bool retval = false; | |
6850 | |
6851 graphics_object go = get_object (h); | |
6852 | |
6853 if (go.valid_object ()) | |
6854 retval = go.is_handle_visible (); | |
6855 | |
6856 return retval; | |
6857 } | |
6858 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6859 OCTINTERP_API void close_all_figures (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6860 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6861 OCTINTERP_API void restore_gcbo (void); |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6862 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6863 OCTINTERP_API void post_event (const graphics_event& e); |
27335
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6864 |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6865 octave::mutex graphics_lock (void) |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6866 { |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6867 return m_graphics_lock; |
50216d7a2f6b
eliminate static wrapper functions in gh_manager class
John W. Eaton <jwe@octave.org>
parents:
27327
diff
changeset
|
6868 } |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6869 |
30299
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6870 latex_data get_latex_data (const std::string& key) const |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6871 { |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6872 latex_data retval; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6873 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6874 const auto it = m_latex_cache.find (key); |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6875 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6876 if (it != m_latex_cache.end ()) |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6877 retval = it->second; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6878 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6879 return retval; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6880 } |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6881 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6882 void set_latex_data (const std::string& key, latex_data val) |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6883 { |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6884 // Limit the number of cache entries to 500 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6885 if (m_latex_keys.size () >= 500) |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6886 { |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6887 auto it = m_latex_cache.find (m_latex_keys.front ()); |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6888 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6889 if (it != m_latex_cache.end ()) |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6890 m_latex_cache.erase (it); |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6891 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6892 m_latex_keys.pop_front (); |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6893 } |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6894 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6895 m_latex_cache[key] = val; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6896 m_latex_keys.push_back (key); |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6897 } |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6898 |
6874 | 6899 private: |
6900 | |
6901 typedef std::map<graphics_handle, graphics_object>::iterator iterator; | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6902 typedef std::map<graphics_handle, graphics_object>::const_iterator |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6903 const_iterator; |
6874 | 6904 |
6905 typedef std::set<graphics_handle>::iterator free_list_iterator; | |
6906 typedef std::set<graphics_handle>::const_iterator const_free_list_iterator; | |
6907 | |
6908 typedef std::list<graphics_handle>::iterator figure_list_iterator; | |
6909 typedef std::list<graphics_handle>::const_iterator const_figure_list_iterator; | |
6910 | |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6911 octave::interpreter& m_interpreter; |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27320
diff
changeset
|
6912 |
6874 | 6913 // A map of handles to graphics objects. |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6914 std::map<graphics_handle, graphics_object> m_handle_map; |
6874 | 6915 |
6916 // The available graphics handles. | |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6917 std::set<graphics_handle> m_handle_free_list; |
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6918 |
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6919 // The next handle available if m_handle_free_list is empty. |
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6920 double m_next_handle; |
6874 | 6921 |
6922 // The allocated figure handles. Top of the stack is most recently | |
6923 // created. | |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6924 std::list<graphics_handle> m_figure_list; |
6874 | 6925 |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
6926 // The lock for accessing the graphics sytsem. |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6927 octave::mutex m_graphics_lock; |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6928 |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
6929 // The list of events queued by graphics toolkits. |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6930 std::list<graphics_event> m_event_queue; |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6931 |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
6932 // The stack of callback objects. |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6933 std::list<graphics_object> m_callback_objects; |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
6934 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6935 // A flag telling whether event processing must be constantly on. |
27327
728e4d99febb
use m_ prefix for gh_manager data members
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
6936 int m_event_processing; |
30299
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6937 |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6938 // Cache of already parsed latex strings. Store a separate list of keys |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6939 // to allow for erasing oldest entries if cache size becomes too large. |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6940 std::unordered_map<std::string, latex_data> m_latex_cache; |
f306fe9bfa0d
Limit the size of the cache of latex parsed strings (bug #59546).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30253
diff
changeset
|
6941 std::list<std::string> m_latex_keys; |
6874 | 6942 }; |
6943 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6944 OCTINTERP_API void |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6945 get_children_limits (double& min_val, double& max_val, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6946 double& min_pos, double& max_neg, |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6947 const Matrix& kids, char limit_type); |
6874 | 6948 |
10917
888c75785221
Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents:
10792
diff
changeset
|
6949 OCTINTERP_API int calc_dimensions (const graphics_object& gh); |
888c75785221
Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents:
10792
diff
changeset
|
6950 |
6874 | 6951 // This function is NOT equivalent to the scripting language function gcf. |
7365 | 6952 OCTINTERP_API graphics_handle gcf (void); |
6874 | 6953 |
6954 // This function is NOT equivalent to the scripting language function gca. | |
7365 | 6955 OCTINTERP_API graphics_handle gca (void); |
6874 | 6956 |
14014
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13992
diff
changeset
|
6957 OCTINTERP_API void close_all_figures (void); |
907d03def9d5
explicitly close figures in clean_up_and_exit instead of using an atexit function
John W. Eaton <jwe@octave.org>
parents:
13992
diff
changeset
|
6958 |
29993
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6959 OCTAVE_NAMESPACE_END |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6960 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6961 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6962 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6963 OCTAVE_DEPRECATED (7, "use 'octave::base_scaler' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6964 typedef octave::base_scaler base_scaler; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6965 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6966 OCTAVE_DEPRECATED (7, "use 'octave::lin_scaler' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6967 typedef octave::lin_scaler lin_scaler; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6968 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6969 OCTAVE_DEPRECATED (7, "use 'octave::log_scaler' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6970 typedef octave::log_scaler log_scaler; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6971 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6972 OCTAVE_DEPRECATED (7, "use 'octave::neg_log_scaler' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6973 typedef octave::neg_log_scaler neg_log_scaler; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6974 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6975 OCTAVE_DEPRECATED (7, "use 'octave::scaler' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6976 typedef octave::scaler scaler; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6977 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6978 OCTAVE_DEPRECATED (7, "use 'octave::base_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6979 typedef octave::base_property base_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6980 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6981 OCTAVE_DEPRECATED (7, "use 'octave::string_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6982 typedef octave::string_property string_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6983 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6984 OCTAVE_DEPRECATED (7, "use 'octave::string_array_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6985 typedef octave::string_array_property string_array_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6986 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6987 OCTAVE_DEPRECATED (7, "use 'octave::text_label_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6988 typedef octave::text_label_property text_label_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6989 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6990 OCTAVE_DEPRECATED (7, "use 'octave::radio_values' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6991 typedef octave::radio_values radio_values; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6992 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6993 OCTAVE_DEPRECATED (7, "use 'octave::radio_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6994 typedef octave::radio_property radio_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6995 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6996 OCTAVE_DEPRECATED (7, "use 'octave::color_values' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6997 typedef octave::color_values color_values; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6998 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6999 OCTAVE_DEPRECATED (7, "use 'octave::color_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7000 typedef octave::color_property color_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7001 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7002 OCTAVE_DEPRECATED (7, "use 'octave::double_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7003 typedef octave::double_property double_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7004 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7005 OCTAVE_DEPRECATED (7, "use 'octave::double_radio_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7006 typedef octave::double_radio_property double_radio_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7007 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7008 OCTAVE_DEPRECATED (7, "use 'octave::array_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7009 typedef octave::array_property array_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7010 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7011 OCTAVE_DEPRECATED (7, "use 'octave::row_vector_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7012 typedef octave::row_vector_property row_vector_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7013 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7014 OCTAVE_DEPRECATED (7, "use 'octave::bool_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7015 typedef octave::bool_property bool_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7016 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7017 OCTAVE_DEPRECATED (7, "use 'octave::handle_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7018 typedef octave::handle_property handle_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7019 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7020 OCTAVE_DEPRECATED (7, "use 'octave::any_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7021 typedef octave::any_property any_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7022 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7023 OCTAVE_DEPRECATED (7, "use 'octave::children_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7024 typedef octave::children_property children_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7025 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7026 OCTAVE_DEPRECATED (7, "use 'octave::callback_property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7027 typedef octave::callback_property callback_property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7028 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7029 OCTAVE_DEPRECATED (7, "use 'octave::property' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7030 typedef octave::property property; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7031 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7032 OCTAVE_DEPRECATED (7, "use 'octave::pval_vector' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7033 typedef octave::pval_vector pval_vector; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7034 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7035 OCTAVE_DEPRECATED (7, "use 'octave::property_list' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7036 typedef octave::property_list property_list; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7037 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7038 OCTAVE_DEPRECATED (7, "use 'octave::base_properties' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7039 typedef octave::base_properties base_properties; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7040 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7041 OCTAVE_DEPRECATED (7, "use 'octave::base_graphics_object' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7042 typedef octave::base_graphics_object base_graphics_object; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7043 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7044 OCTAVE_DEPRECATED (7, "use 'octave::graphics_object' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7045 typedef octave::graphics_object graphics_object; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7046 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7047 OCTAVE_DEPRECATED (7, "use 'octave::root_figure' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7048 typedef octave::root_figure root_figure; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7049 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7050 OCTAVE_DEPRECATED (7, "use 'octave::figure' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7051 typedef octave::figure figure; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7052 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7053 OCTAVE_DEPRECATED (7, "use 'octave::graphics_xform' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7054 typedef octave::graphics_xform graphics_xform; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7055 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7056 OCTAVE_DEPRECATED (7, "use 'octave::axes' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7057 typedef octave::axes axes; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7058 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7059 OCTAVE_DEPRECATED (7, "use 'octave::line' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7060 typedef octave::line line; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7061 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7062 OCTAVE_DEPRECATED (7, "use 'octave::text' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7063 typedef octave::text text; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7064 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7065 OCTAVE_DEPRECATED (7, "use 'octave::image' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7066 typedef octave::image image; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7067 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7068 OCTAVE_DEPRECATED (7, "use 'octave::light' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7069 typedef octave::light light; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7070 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7071 OCTAVE_DEPRECATED (7, "use 'octave::patch' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7072 typedef octave::patch patch; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7073 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7074 OCTAVE_DEPRECATED (7, "use 'octave::scatter' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7075 typedef octave::scatter scatter; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7076 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7077 OCTAVE_DEPRECATED (7, "use 'octave::surface' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7078 typedef octave::surface surface; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7079 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7080 OCTAVE_DEPRECATED (7, "use 'octave::hggroup' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7081 typedef octave::hggroup hggroup; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7082 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7083 OCTAVE_DEPRECATED (7, "use 'octave::uimenu' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7084 typedef octave::uimenu uimenu; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7085 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7086 OCTAVE_DEPRECATED (7, "use 'octave::uicontextmenu' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7087 typedef octave::uicontextmenu uicontextmenu; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7088 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7089 OCTAVE_DEPRECATED (7, "use 'octave::uicontrol' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7090 typedef octave::uicontrol uicontrol; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7091 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7092 OCTAVE_DEPRECATED (7, "use 'octave::uibuttongroup' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7093 typedef octave::uibuttongroup uibuttongroup; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7094 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7095 OCTAVE_DEPRECATED (7, "use 'octave::uipanel' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7096 typedef octave::uipanel uipanel; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7097 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7098 OCTAVE_DEPRECATED (7, "use 'octave::uitable' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7099 typedef octave::uitable uitable; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7100 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7101 OCTAVE_DEPRECATED (7, "use 'octave::uitoolbar' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7102 typedef octave::uitoolbar uitoolbar; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7103 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7104 OCTAVE_DEPRECATED (7, "use 'octave::uipushtool' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7105 typedef octave::uipushtool uipushtool; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7106 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7107 OCTAVE_DEPRECATED (7, "use 'octave::uitoggletool' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7108 typedef octave::uitoggletool uitoggletool; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7109 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7110 OCTAVE_DEPRECATED (7, "use 'octave::base_graphics_event' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7111 typedef octave::base_graphics_event base_graphics_event; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7112 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7113 OCTAVE_DEPRECATED (7, "use 'octave::graphics_event' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7114 typedef octave::graphics_event graphics_event; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7115 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7116 OCTAVE_DEPRECATED (7, "use 'octave::gh_manager' instead") |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7117 typedef octave::gh_manager gh_manager; |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7118 |
6874 | 7119 #endif |
29993
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7120 |
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
7121 #endif |