Mercurial > octave
annotate libinterp/corefcn/graphics.in.h @ 33614:7f7d6bc5702b default tip @
maint: merge stable to default
author | Rik <rik@octave.org> |
---|---|
date | Mon, 20 May 2024 09:12:08 -0700 |
parents | 79cfa1b7a813 |
children |
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 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
32589
diff
changeset
|
3 // Copyright (C) 2007-2024 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 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
31241
diff
changeset
|
55 OCTAVE_BEGIN_NAMESPACE(octave) |
29993
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: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
69 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
70 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE (base_scaler) |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
71 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
72 virtual ~base_scaler () = default; |
7440 | 73 |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
74 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
|
75 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
76 error ("invalid axis scale"); |
20893
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 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
79 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
|
80 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
81 error ("invalid axis scale"); |
20893
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 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
84 virtual double scale (double) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
85 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
86 error ("invalid axis scale"); |
20893
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 |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
89 virtual double unscale (double) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
90 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
91 error ("invalid axis scale"); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
92 } |
7427 | 93 |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23447
diff
changeset
|
94 virtual base_scaler * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
95 { 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
|
96 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
97 virtual bool is_linear () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
98 { return false; } |
7427 | 99 }; |
100 | |
101 class lin_scaler : public base_scaler | |
102 { | |
103 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
104 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
105 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (lin_scaler) |
7427 | 106 |
107 Matrix scale (const Matrix& m) const { return m; } | |
108 | |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
109 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
|
110 |
7427 | 111 double scale (double d) const { return d; } |
112 | |
113 double unscale (double d) const { return d; } | |
114 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
115 base_scaler * clone () const { return new lin_scaler (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
116 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
117 bool is_linear () const { return true; } |
7427 | 118 }; |
119 | |
120 class log_scaler : public base_scaler | |
121 { | |
122 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
123 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
124 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (log_scaler) |
7427 | 125 |
126 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
|
127 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
128 Matrix retval (m.rows (), m.cols ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
129 |
32660
f53ac65ffba6
maint: New method rwdata() as clearer alternative to fortran_vec().
Rik <rik@octave.org>
parents:
32633
diff
changeset
|
130 do_scale (m.data (), retval.rwdata (), m.numel ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
131 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
132 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
133 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
134 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
135 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
|
136 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
137 NDArray retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 |
32660
f53ac65ffba6
maint: New method rwdata() as clearer alternative to fortran_vec().
Rik <rik@octave.org>
parents:
32633
diff
changeset
|
139 do_scale (m.data (), retval.rwdata (), m.numel ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
140 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
142 } |
7427 | 143 |
144 double scale (double d) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
145 { return log10 (d); } |
7427 | 146 |
147 double unscale (double d) const | |
23639 | 148 { return std::pow (10.0, d); } |
7427 | 149 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
150 base_scaler * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
151 { 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
|
152 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
153 private: |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
154 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
|
155 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
156 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
|
157 dest[i] = log10 (src[i]); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
158 } |
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 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
161 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
|
162 { |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
163 public: |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
164 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
165 OCTAVE_DEFAULT_CONSTRUCT_COPY_MOVE_DELETE (neg_log_scaler) |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
166 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
167 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
|
168 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
169 Matrix retval (m.rows (), m.cols ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
170 |
32660
f53ac65ffba6
maint: New method rwdata() as clearer alternative to fortran_vec().
Rik <rik@octave.org>
parents:
32633
diff
changeset
|
171 do_scale (m.data (), retval.rwdata (), m.numel ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
172 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 } |
13756
6dfebfa334cb
allow negative data log plots with OpenGL+FLTK graphics (bug #34232)
John W. Eaton <jwe@octave.org>
parents:
13722
diff
changeset
|
175 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
176 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
|
177 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
178 NDArray retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
179 |
32660
f53ac65ffba6
maint: New method rwdata() as clearer alternative to fortran_vec().
Rik <rik@octave.org>
parents:
32633
diff
changeset
|
180 do_scale (m.data (), retval.rwdata (), m.numel ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
181 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
182 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
183 } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
184 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
185 double scale (double d) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
186 { return -log10 (-d); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
187 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
188 double unscale (double d) const |
23639 | 189 { return -std::pow (10.0, -d); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
190 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
191 base_scaler * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
192 { return new neg_log_scaler (); } |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
193 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
194 private: |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
195 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
|
196 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
197 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
|
198 dest[i] = -log10 (-src[i]); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
199 } |
7427 | 200 }; |
201 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
202 class OCTINTERP_API scaler |
7427 | 203 { |
204 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
205 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
206 scaler () : m_rep (new base_scaler ()) { } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
207 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
208 scaler (const scaler& s) : m_rep (s.m_rep->clone ()) { } |
7427 | 209 |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
210 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
|
211 : 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
|
212 ? 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
|
213 : (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
|
214 ? 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
|
215 : (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
|
216 ? 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
|
217 : new base_scaler ()))) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
218 { } |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
219 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
220 ~scaler () { delete m_rep; } |
7427 | 221 |
222 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
|
223 { return m_rep->scale (m); } |
7427 | 224 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
225 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
|
226 { 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
|
227 |
7427 | 228 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
|
229 { return m_rep->scale (d); } |
7427 | 230 |
231 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
|
232 { return m_rep->unscale (d); } |
7427 | 233 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
234 bool is_linear () 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
|
235 { 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
|
236 |
7427 | 237 scaler& operator = (const scaler& s) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
238 { |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
239 if (&s != this) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
240 { |
32733
1c40194c7b1f
eliminate useless "if (ptr)" checks protecting "delete ptr" statements.
John W. Eaton <jwe@octave.org>
parents:
32632
diff
changeset
|
241 delete m_rep; |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
242 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
243 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
|
244 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
245 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
246 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
247 } |
7427 | 248 |
249 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
|
250 { |
32733
1c40194c7b1f
eliminate useless "if (ptr)" checks protecting "delete ptr" statements.
John W. Eaton <jwe@octave.org>
parents:
32632
diff
changeset
|
251 delete m_rep; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
252 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
253 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
|
254 m_rep = new log_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
255 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
|
256 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
|
257 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
|
258 m_rep = new lin_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
259 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
|
260 m_rep = new base_scaler (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
261 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
262 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
263 } |
7427 | 264 |
265 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
|
266 base_scaler *m_rep; |
7427 | 267 }; |
268 | |
269 // --------------------------------------------------------------------- | |
270 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
271 class OCTINTERP_API property; |
7363 | 272 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
273 // 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
|
274 // 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
|
275 // "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
|
276 // 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
|
277 |
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
278 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
|
279 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
280 class OCTINTERP_API base_property |
7363 | 281 { |
282 public: | |
283 friend class property; | |
284 | |
285 public: | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
286 base_property () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
287 : 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
|
288 m_listeners () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
289 { } |
7363 | 290 |
291 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
|
292 : 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
|
293 m_listeners () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
294 { } |
7363 | 295 |
296 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
|
297 : 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
|
298 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
|
299 { } |
7363 | 300 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
301 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
302 base_property& operator = (const base_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
303 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
304 virtual ~base_property () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
305 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
306 bool ok () const { return m_parent.ok (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
307 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
308 std::string get_name () const { return m_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
|
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
312 graphics_handle get_parent () const { return m_parent; } |
29889
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
316 bool is_hidden () const { return m_hidden; } |
29889
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
320 virtual bool is_radio () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
321 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
322 int get_id () const { return m_id; } |
29889
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
331 virtual octave_value get () 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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
336 virtual std::string values_as_string () 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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
341 virtual Cell values_as_cell () 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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
411 virtual base_property * clone () 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: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
441 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
442 string_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
443 |
7363 | 444 string_property (const std::string& s, const graphics_handle& h, |
445 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
|
446 : base_property (s, h), m_str (val) { } |
7363 | 447 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
448 string_property (const string_property&) = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
449 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
450 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
451 string_property& operator = (const string_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
452 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
453 ~string_property () = default; |
7363 | 454 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
455 octave_value get () 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
|
456 { 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
|
457 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
458 std::string string_value () const { return m_str; } |
7363 | 459 |
460 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
|
461 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
462 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
463 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
464 } |
7363 | 465 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
466 base_property * clone () const { return new string_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
467 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
468 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
469 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
|
470 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
471 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
|
472 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
|
473 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
474 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
475 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
|
476 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
477 if (new_str != m_str) |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
478 { |
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 m_str = new_str; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
480 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
481 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
482 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
483 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
484 |
7363 | 485 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
|
486 std::string m_str; |
7363 | 487 }; |
488 | |
489 // --------------------------------------------------------------------- | |
490 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
491 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
|
492 { |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
493 public: |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
494 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
|
495 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
496 string_array_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
497 |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
498 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
|
499 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
|
500 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
|
501 : 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
|
502 { |
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
|
503 std::size_t pos = 0; |
17787
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 while (true) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
506 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
507 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
|
508 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
509 if (new_pos == std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
510 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
511 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
|
512 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
513 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
514 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
|
515 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
|
516 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
517 pos = new_pos + 1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
518 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
519 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
520 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
521 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
|
522 const Cell& c, const char& sep = '|', |
830f27544bb7
Accept char array inputs for linestyleorder property (bug #34906).
Rik <rik@octave.org>
parents:
16832
diff
changeset
|
523 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
|
524 : 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
|
525 { |
23575
e95738a119da
maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents:
23564
diff
changeset
|
526 if (! c.iscellstr ()) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
527 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
|
528 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
529 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
530 string_vector strings (c.numel ()); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
531 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
532 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
|
533 strings[i] = c(i).string_value (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
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 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
536 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
537 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
538 string_array_property (const string_array_property&) = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
539 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
540 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
541 string_array_property& operator = (const string_array_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
542 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
543 ~string_array_property () = default; |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
544 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
545 octave_value get () const |
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 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
|
548 return octave_value (string_value ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
549 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
550 return octave_value (cell_value ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
551 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
552 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
553 std::string string_value () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
554 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
555 std::string s; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
556 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
557 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
|
558 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
559 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
|
560 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
|
561 s += m_separator; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
562 } |
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 return s; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
565 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
566 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
567 Cell cell_value () const {return Cell (m_str);} |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
568 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
569 string_vector string_vector_value () 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
|
570 |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
571 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
|
572 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
573 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
574 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
575 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
576 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
577 base_property * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
578 { 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
|
579 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
580 protected: |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
581 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
|
582 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
583 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
|
584 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
585 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
586 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
|
587 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
|
588 std::size_t pos = 0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
589 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
590 // Split single string on delimiter (usually '|') |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
591 while (pos != std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
592 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
593 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
|
594 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
595 if (new_pos == std::string::npos) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
596 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
597 strings.append (new_str.substr (pos)); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
598 break; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
599 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
600 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
601 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
|
602 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
603 pos = new_pos + 1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
604 } |
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 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
|
607 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
608 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
|
609 if (strings[i] != m_str[i]) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
610 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
611 replace = true; |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
612 break; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
613 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
614 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
615 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
616 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
617 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
618 m_desired_type = string_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
619 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
620 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
621 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
622 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
623 return true; |
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 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
626 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
|
627 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
628 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
629 charMatrix chm = val.char_matrix_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
630 octave_idx_type nel = chm.rows (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
631 string_vector strings (nel); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
632 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
633 if (nel != m_str.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
634 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
635 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
|
636 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
637 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
|
638 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
|
639 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
640 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
641 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
642 m_desired_type = string_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
643 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
644 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
645 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
646 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
647 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
648 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
649 } |
23575
e95738a119da
maint: Deprecate is_cellstr and replace with iscellstr.
Rik <rik@octave.org>
parents:
23564
diff
changeset
|
650 else if (val.iscellstr ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
651 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
652 bool replace = false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
653 Cell new_cell = val.cell_value (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
654 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
655 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
|
656 |
20232
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20181
diff
changeset
|
657 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
|
658 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
659 if (nel != m_str.numel ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
660 replace = true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
661 else |
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 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
|
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 if (strings[i] != m_str[i]) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
666 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
667 replace = true; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
668 break; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
669 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
670 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
671 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
672 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
673 m_desired_type = cell_t; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
674 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
675 if (replace) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
676 { |
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 m_str = strings; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
678 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
679 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
680 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
681 else |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
682 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
|
683 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
|
684 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
685 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
686 } |
10135
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
687 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
688 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
|
689 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
|
690 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
|
691 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
|
692 }; |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
693 |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
694 // --------------------------------------------------------------------- |
4516a0c97ced
Handle linestyleorder. Remove @ markers. Treat edgecolor, markeredgecolor and markerfacecolor correctly in scatter.
David Bateman <dbateman@free.fr>
parents:
10121
diff
changeset
|
695 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
696 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
|
697 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
698 public: |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
699 enum type { char_t, cellstr_t }; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
700 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
701 text_label_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
702 |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
703 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
|
704 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
|
705 : 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
|
706 { } |
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 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
|
709 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
|
710 : 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
|
711 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
712 octave_idx_type nel = nda.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
713 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
714 m_value.resize (nel); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
715 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
716 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
|
717 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
718 std::ostringstream buf; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
719 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
|
720 m_value[i] = buf.str (); |
12959
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 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
723 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
724 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
|
725 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
|
726 : 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
|
727 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
728 octave_idx_type nel = c.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
729 |
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.resize (nel); |
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 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
|
733 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
734 octave_value tmp = c(i); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
735 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
736 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
|
737 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
|
738 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
739 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
740 double d = c(i).double_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
741 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
742 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
743 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
|
744 m_value[i] = buf.str (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
745 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
746 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
747 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
748 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
749 text_label_property (const text_label_property&) = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
750 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
751 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
752 text_label_property& operator = (const text_label_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
753 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
754 ~text_label_property () = default; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
755 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
756 bool empty () const |
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
|
757 { |
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
758 octave_value tmp = get (); |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
759 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
|
760 } |
22bc9ec80c2c
allow multi-line string property for text objects using cell arrays or char matrices
Ben Abbott <bpabbott@mac.com>
parents:
12959
diff
changeset
|
761 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
762 octave_value get () const |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
763 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
764 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
|
765 return octave_value (char_value ()); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
766 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
767 return octave_value (cell_value ()); |
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
770 std::string string_value () const |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
771 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
772 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
|
773 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
774 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
775 string_vector string_vector_value () const { return m_value; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
776 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
777 charMatrix char_value () const { return charMatrix (m_value, ' '); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
778 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
779 Cell cell_value () const {return Cell (m_value); } |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
780 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
781 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
|
782 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
783 set (val); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
784 return *this; |
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
787 base_property * clone () 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
|
788 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
789 protected: |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
790 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
791 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
|
792 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
793 if (val.is_string ()) |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
794 { |
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 = 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
|
796 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
797 m_stored_type = char_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
798 } |
23576
00e518162fda
maint: Deprecate is_cell and replace with iscell.
Rik <rik@octave.org>
parents:
23575
diff
changeset
|
799 else if (val.iscell ()) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
800 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
801 Cell c = val.cell_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
802 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
803 octave_idx_type nel = c.numel (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
804 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
805 m_value.resize (nel); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
806 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
807 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
|
808 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
809 octave_value tmp = c(i); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
810 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
811 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
|
812 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
|
813 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
814 { |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
815 double d = c(i).double_value (); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
816 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
817 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
818 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
|
819 m_value[i] = buf.str (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
820 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
821 } |
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
|
822 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
823 m_stored_type = cellstr_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
824 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
825 else |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
826 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
827 NDArray nda; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
828 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
829 try |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
830 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
831 nda = val.array_value (); |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
832 } |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
833 catch (octave::execution_exception& ee) |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
834 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
835 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
|
836 get_name ().c_str ()); |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
837 } |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
838 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
839 octave_idx_type nel = nda.numel (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
840 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
841 m_value.resize (nel); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
842 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
843 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
|
844 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
845 std::ostringstream buf; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
846 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
|
847 m_value[i] = buf.str (); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
848 } |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
849 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
850 m_stored_type = char_t; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
851 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
852 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
853 return true; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
854 } |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
855 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
856 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
|
857 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
|
858 type m_stored_type; |
12959
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
859 }; |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
860 |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
861 // --------------------------------------------------------------------- |
0c86ae6f7c34
new text_label_property graphics property type
John W. Eaton <jwe@octave.org>
parents:
12777
diff
changeset
|
862 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
863 class OCTINTERP_API radio_values |
7363 | 864 { |
865 public: | |
21017
93748bcaec17
maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents:
20990
diff
changeset
|
866 OCTINTERP_API radio_values (const std::string& opt_string = ""); |
7363 | 867 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
868 OCTAVE_DEFAULT_COPY_MOVE_DELETE (radio_values) |
7363 | 869 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
870 std::string default_value () const { return m_default_val; } |
7363 | 871 |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
872 bool validate (const std::string& val, std::string& match) |
7363 | 873 { |
874 bool retval = true; | |
875 | |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
876 if (! contains (val, match)) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
877 error ("invalid value = %s", val.c_str ()); |
7363 | 878 |
879 return retval; | |
880 } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
881 |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
882 bool contains (const std::string& val, std::string& match) |
7363 | 883 { |
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
|
884 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
|
885 |
d13d090cb03a
use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
886 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
|
887 |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
888 std::string first_match; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
889 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
890 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
|
891 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
892 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
|
893 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
894 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
|
895 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
896 // 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
|
897 // 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
|
898 // 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
|
899 match = possible_val; |
13236
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
900 return true; |
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 else |
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 if (k == 0) |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
905 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
|
906 |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
907 k++; |
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 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
910 } |
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 if (k == 1) |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
913 { |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
914 match = first_match; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
915 return true; |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
916 } |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
917 else |
8bb526fb3349
allow radio values for graphics properaties to be abbreviated
John W. Eaton <jwe@octave.org>
parents:
13132
diff
changeset
|
918 return false; |
7363 | 919 } |
920 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
921 OCTINTERP_API std::string values_as_string () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
922 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
923 OCTINTERP_API Cell values_as_cell () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
924 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
925 octave_idx_type nelem () const { return m_possible_vals.size (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
926 |
7363 | 927 private: |
928 // 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
|
929 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
|
930 std::set<caseless_str> m_possible_vals; |
7363 | 931 }; |
932 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
933 class OCTINTERP_API radio_property : public base_property |
7363 | 934 { |
935 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
936 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
937 radio_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
938 |
7364 | 939 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 940 const radio_values& v = radio_values ()) |
7364 | 941 : 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
|
942 m_vals (v), m_current_val (v.default_value ()) { } |
7363 | 943 |
7364 | 944 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 945 const std::string& v) |
7364 | 946 : 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
|
947 m_vals (v), m_current_val (m_vals.default_value ()) { } |
7363 | 948 |
7364 | 949 radio_property (const std::string& nm, const graphics_handle& h, |
7363 | 950 const radio_values& v, const std::string& def) |
7364 | 951 : 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
|
952 m_vals (v), m_current_val (def) { } |
7363 | 953 |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
954 OCTAVE_DEFAULT_COPY_MOVE_CTOR (radio_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
955 OCTAVE_DISABLE_COPY_MOVE_ASGN (radio_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
956 |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
957 ~radio_property () = 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
|
958 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
959 octave_value get () const { return octave_value (m_current_val); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
960 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
961 const std::string& current_value () const { return m_current_val; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
962 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
963 std::string values_as_string () const |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
964 { 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
|
965 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
966 Cell values_as_cell () 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
|
967 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
968 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
|
969 { 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
|
970 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
971 bool is_radio () const { return true; } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
972 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
973 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
|
974 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
975 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
976 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
977 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
978 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
979 base_property * clone () const { return new radio_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
980 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
981 protected: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
982 bool do_set (const octave_value& newval) |
7363 | 983 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
984 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
|
985 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
|
986 get_name ().c_str ()); |
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 std::string s = newval.string_value (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
989 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
990 std::string match; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
991 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
992 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
|
993 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
|
994 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
|
995 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
996 if (match != m_current_val) |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
997 { |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
998 if (s.length () != match.length ()) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
999 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
|
1000 "%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
|
1001 "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
|
1002 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
|
1003 m_current_val = match; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1004 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1005 } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1006 return false; |
7363 | 1007 } |
1008 | |
1009 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
|
1010 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
|
1011 std::string m_current_val; |
7363 | 1012 }; |
1013 | |
1014 // --------------------------------------------------------------------- | |
1015 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1016 class OCTINTERP_API color_values |
7363 | 1017 { |
1018 public: | |
1019 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
|
1020 : 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
|
1021 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1022 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
|
1023 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
|
1024 m_rgb(2) = b; |
7363 | 1025 |
1026 validate (); | |
1027 } | |
1028 | |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1029 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
|
1030 : m_rgb (1, 3) |
7363 | 1031 { |
1032 if (! str2rgb (str)) | |
1033 error ("invalid color specification: %s", str.c_str ()); | |
1034 } | |
1035 | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1036 OCTAVE_DEFAULT_COPY_MOVE_DELETE (color_values) |
7363 | 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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1048 Matrix rgb () const { return m_rgb; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1049 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1050 operator octave_value () const { return m_rgb; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1051 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1052 void validate () const |
7363 | 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: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1070 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1071 color_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1072 |
7363 | 1073 color_property (const color_values& c, const radio_values& v) |
1074 : 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
|
1075 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
|
1076 m_current_val (v.default_value ()) |
7363 | 1077 { } |
1078 | |
17645
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1079 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
|
1080 : 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
|
1081 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
|
1082 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
|
1083 { } |
85a057ad1ba6
Fix graphic color properties which have a radio value as default.
Rik <rik@octave.org>
parents:
17631
diff
changeset
|
1084 |
7364 | 1085 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1086 const color_values& c = color_values (), |
1087 const radio_values& v = radio_values ()) | |
7364 | 1088 : 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
|
1089 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
|
1090 m_current_val (v.default_value ()) |
7363 | 1091 { } |
1092 | |
7364 | 1093 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1094 const radio_values& v) |
7364 | 1095 : 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
|
1096 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
|
1097 m_current_val (v.default_value ()) |
7363 | 1098 { } |
1099 | |
7364 | 1100 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1101 const std::string& v) |
7364 | 1102 : 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
|
1103 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
|
1104 m_current_val (m_radio_val.default_value ()) |
7363 | 1105 { } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1106 |
7364 | 1107 color_property (const std::string& nm, const graphics_handle& h, |
7363 | 1108 const color_property& v) |
7364 | 1109 : 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
|
1110 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
|
1111 m_radio_val (v.m_radio_val), m_current_val (v.m_current_val) |
7363 | 1112 { } |
1113 | |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1114 OCTAVE_DEFAULT_COPY_MOVE_CTOR (color_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1115 OCTAVE_DISABLE_COPY_MOVE_ASGN (color_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1116 |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1117 ~color_property () = default; |
7363 | 1118 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1119 octave_value get () const |
7363 | 1120 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1121 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
|
1122 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
|
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 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
|
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1127 bool is_rgb () const { return (m_current_type == color_t); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1128 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1129 bool is_radio () const { return (m_current_type == radio_t); } |
7363 | 1130 |
1131 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
|
1132 { return (is_radio () && m_current_val == v); } |
7363 | 1133 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1134 Matrix rgb () const |
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 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
|
1137 error ("color has no RGB value"); |
7363 | 1138 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1139 return m_color_val.rgb (); |
7363 | 1140 } |
1141 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1142 const std::string& current_value () const |
7363 | 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 if (m_current_type != radio_t) |
7363 | 1145 error ("color has no radio value"); |
1146 | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1147 return m_current_val; |
7363 | 1148 } |
1149 | |
1150 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
|
1151 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1152 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1153 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1154 } |
7363 | 1155 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1156 operator octave_value () const { return get (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1157 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1158 base_property * clone () const { return new color_property (*this); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1159 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1160 std::string values_as_string () 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
|
1161 { 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
|
1162 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1163 Cell values_as_cell () 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
|
1164 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1165 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1166 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
|
1167 |
7363 | 1168 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
|
1169 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
|
1170 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
|
1171 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
|
1172 std::string m_current_val; |
7363 | 1173 }; |
1174 | |
1175 // --------------------------------------------------------------------- | |
1176 | |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1177 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
|
1178 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1179 NO_CHECK, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1180 FINITE, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1181 NOT_NAN, |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1182 NOT_INF |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1183 }; |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1184 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1185 class OCTINTERP_API double_property : public base_property |
7363 | 1186 { |
1187 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1188 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1189 double_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1190 |
7364 | 1191 double_property (const std::string& nm, const graphics_handle& h, |
7363 | 1192 double d = 0) |
7364 | 1193 : 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
|
1194 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
|
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)) { } |
7363 | 1197 |
1198 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
|
1199 : 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
|
1200 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
|
1201 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
|
1202 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
|
1203 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1204 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1205 double_property& operator = (const double_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1206 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1207 ~double_property () = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1208 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1209 octave_value get () const { return octave_value (m_current_val); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1210 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1211 double double_value () const { return m_current_val; } |
7363 | 1212 |
1213 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
|
1214 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1215 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1216 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1217 } |
7363 | 1218 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1219 base_property * clone () const |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1220 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1221 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
|
1222 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1223 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
|
1224 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
|
1225 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
|
1226 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1227 return p; |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1228 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1229 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1230 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
|
1231 { |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1232 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
|
1233 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
|
1234 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
|
1235 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
|
1236 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1237 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1238 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
|
1239 { m_finite_constraint = finite; } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1240 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1241 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1242 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
|
1243 { |
23582
0cc2011d800e
maint: Deprecate is_real_type and replace with isreal.
Rik <rik@octave.org>
parents:
23577
diff
changeset
|
1244 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
|
1245 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
|
1246 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
|
1247 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1248 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
|
1249 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1250 // 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
|
1251 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
|
1252 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1253 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
|
1254 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
|
1255 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
|
1256 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
|
1257 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
|
1258 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
|
1259 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1260 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1261 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
|
1262 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1263 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
|
1264 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
|
1265 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
|
1266 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
|
1267 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
|
1268 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
|
1269 } |
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
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 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
|
1272 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
|
1273 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1274 if (! octave::math::isfinite (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1275 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
|
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 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
|
1278 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1279 if (octave::math::isnan (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1280 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
|
1281 } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1282 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
|
1283 { |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1284 if (octave::math::isinf (new_val)) |
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
1285 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
|
1286 } |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1287 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1288 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
|
1289 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1290 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
|
1291 return true; |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1292 } |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
1293 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1294 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1295 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1296 |
7363 | 1297 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
|
1298 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
|
1299 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
|
1300 std::pair<double, bool> m_minval, m_maxval; |
7363 | 1301 }; |
1302 | |
1303 // --------------------------------------------------------------------- | |
1304 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1305 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
|
1306 { |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1307 public: |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1308 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1309 double_radio_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1310 |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1311 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
|
1312 : 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
|
1313 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
|
1314 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
|
1315 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1316 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1317 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
|
1318 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
|
1319 : 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
|
1320 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
|
1321 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
|
1322 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1323 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1324 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
|
1325 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
|
1326 : 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
|
1327 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
|
1328 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
|
1329 { } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1330 |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1331 OCTAVE_DEFAULT_COPY_MOVE_CTOR (double_radio_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1332 OCTAVE_DISABLE_COPY_MOVE_ASGN (double_radio_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1333 |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1334 ~double_radio_property () = default; |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1335 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1336 octave_value get () const |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1337 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1338 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
|
1339 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
|
1340 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1341 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
|
1342 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1343 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1344 bool is_double () const { return (m_current_type == double_t); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1345 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1346 bool is_radio () 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
|
1347 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1348 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
|
1349 { 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
|
1350 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1351 double double_value () const |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1352 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1353 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
|
1354 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
|
1355 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1356 return m_dval; |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1357 } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1358 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1359 const std::string& current_value () const |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1360 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1361 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
|
1362 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
|
1363 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1364 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
|
1365 } |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1366 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1367 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
|
1368 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1369 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1370 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1371 } |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1372 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1373 operator octave_value () const { return get (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1374 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1375 base_property * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1376 { return new double_radio_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1377 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1378 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1379 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
|
1380 |
7844
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1381 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
|
1382 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
|
1383 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
|
1384 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
|
1385 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
|
1386 }; |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1387 |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1388 // --------------------------------------------------------------------- |
3d60445d3638
Add new double_radio_property class for alpha values.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7842
diff
changeset
|
1389 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1390 class OCTINTERP_API array_property : public base_property |
7363 | 1391 { |
1392 public: | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1393 array_property () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1394 : 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
|
1395 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
|
1396 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
|
1397 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
|
1398 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
|
1399 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
|
1400 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1401 get_data_limits (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1402 } |
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
|
1403 |
7364 | 1404 array_property (const std::string& nm, const graphics_handle& h, |
7363 | 1405 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
|
1406 : 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
|
1407 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
|
1408 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
|
1409 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
|
1410 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
|
1411 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
|
1412 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1413 get_data_limits (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1414 } |
7363 | 1415 |
7848
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1416 // 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
|
1417 // 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
|
1418 // copy constraints. |
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1419 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
|
1420 : 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
|
1421 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
|
1422 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
|
1423 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
|
1424 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
|
1425 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
|
1426 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
|
1427 { } |
7848
6bb2bbc2bf45
Remove data_property, replace with array_property or row_vector_property.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7847
diff
changeset
|
1428 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1429 // FIXME: Should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1430 array_property& operator = (const array_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1431 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1432 ~array_property () = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1433 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1434 octave_value get () const { return m_data; } |
7363 | 1435 |
1436 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
|
1437 { m_type_constraints.insert (type); } |
7363 | 1438 |
7524
a653856aa3e1
array_value::add_constraint: pass dim_vector as const reference, not value
John W. Eaton <jwe@octave.org>
parents:
7523
diff
changeset
|
1439 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
|
1440 { m_size_constraints.push_back (dims); } |
7363 | 1441 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1442 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
|
1443 { 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
|
1444 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1445 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
|
1446 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1447 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
|
1448 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
|
1449 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
|
1450 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
|
1451 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1452 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1453 double min_val () const { return m_min_val; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1454 double max_val () const { return m_max_val; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1455 double min_pos () const { return m_min_pos; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1456 double max_neg () const { return m_max_neg; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1457 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1458 Matrix get_limits () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1459 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1460 Matrix m (1, 4); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1461 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1462 m(0) = min_val (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1463 m(1) = max_val (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1464 m(2) = min_pos (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1465 m(3) = max_neg (); |
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 m; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1468 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
1469 |
7363 | 1470 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
|
1471 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1472 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1473 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1474 } |
7363 | 1475 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1476 base_property * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1477 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1478 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
|
1479 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1480 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
|
1481 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
|
1482 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
|
1483 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
|
1484 p->m_maxval = m_maxval; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1485 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1486 return p; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1487 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1488 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1489 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1490 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
|
1491 { |
23583
b7747a2c88b2
maint: Deprecate is_sparse_type and replace with issparse.
Rik <rik@octave.org>
parents:
23582
diff
changeset
|
1492 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
|
1493 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1494 if (! validate (tmp)) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
1495 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
|
1496 get_name ().c_str ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1497 |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1498 // 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
|
1499 if (! is_equal (tmp)) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1500 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1501 m_data = tmp; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1502 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1503 get_data_limits (); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1504 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1505 return true; |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1506 } |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
1507 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1508 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1509 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1510 |
7363 | 1511 private: |
1512 OCTINTERP_API bool validate (const octave_value& v); | |
1513 | |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1514 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
|
1515 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1516 OCTINTERP_API void get_data_limits (); |
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
|
1517 |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1518 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
|
1519 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
|
1520 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
|
1521 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
|
1522 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
|
1523 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
|
1524 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
|
1525 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
|
1526 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
|
1527 std::pair<double, bool> m_minval, m_maxval; |
7363 | 1528 }; |
1529 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1530 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
|
1531 { |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1532 public: |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1533 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1534 row_vector_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1535 |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1536 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
|
1537 const octave_value& m) |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1538 : array_property (nm, h, m) |
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 add_constraint (dim_vector (-1, 1)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1541 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
|
1542 add_constraint (dim_vector (0, 0)); |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1543 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1544 |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1545 row_vector_property (const row_vector_property& p) |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1546 : array_property (p) |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1547 { |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1548 add_constraint (dim_vector (-1, 1)); |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1549 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
|
1550 add_constraint (dim_vector (0, 0)); |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1551 } |
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1552 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1553 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1554 row_vector_property& operator = (const row_vector_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1555 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1556 ~row_vector_property () = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1557 |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1558 void add_constraint (const std::string& type) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1559 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1560 array_property::add_constraint (type); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1561 } |
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 void add_constraint (const dim_vector& dims) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1564 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1565 array_property::add_constraint (dims); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1566 } |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1567 |
23124
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1568 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
|
1569 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1570 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
|
1571 } |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1572 |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1573 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
|
1574 { |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1575 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
|
1576 } |
9e54152e382b
Add new types of constraints for graphics properties (bug #50041).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23116
diff
changeset
|
1577 |
7527
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1578 void add_constraint (octave_idx_type len) |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1579 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1580 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
|
1581 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
|
1582 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
|
1583 |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1584 add_constraint (dim_vector (1, len)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1585 add_constraint (dim_vector (len, 1)); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1586 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1587 |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1588 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
|
1589 { |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1590 set (val); |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1591 return *this; |
d219e712c20e
make row_vector_property work?
John W. Eaton <jwe@octave.org>
parents:
7526
diff
changeset
|
1592 } |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1593 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1594 base_property * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1595 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1596 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
|
1597 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1598 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
|
1599 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
|
1600 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
|
1601 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
|
1602 p->m_maxval = m_maxval; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1603 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1604 return p; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1605 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1606 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1607 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1608 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
|
1609 { |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1610 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
|
1611 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1612 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
|
1613 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1614 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
|
1615 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1616 int tmp = dv(0); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1617 dv(0) = dv(1); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1618 dv(1) = tmp; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1619 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1620 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
|
1621 } |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1622 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1623 return retval; |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1624 } |
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1625 |
7523
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1626 private: |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1627 OCTINTERP_API bool validate (const octave_value& v); |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1628 }; |
f2000f1971ab
new row_vector_property class
John W. Eaton <jwe@octave.org>
parents:
7471
diff
changeset
|
1629 |
7363 | 1630 // --------------------------------------------------------------------- |
1631 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1632 class OCTINTERP_API bool_property : public radio_property |
7363 | 1633 { |
1634 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1635 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1636 bool_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1637 |
7364 | 1638 bool_property (const std::string& nm, const graphics_handle& h, |
7363 | 1639 bool val) |
7364 | 1640 : 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
|
1641 { } |
7363 | 1642 |
7364 | 1643 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
|
1644 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
|
1645 : 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
|
1646 "{on}|off" : "on|{off}"), val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1647 { } |
7363 | 1648 |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1649 OCTAVE_DEFAULT_COPY_MOVE_CTOR (bool_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1650 OCTAVE_DISABLE_COPY_MOVE_ASGN (bool_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1651 |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1652 ~bool_property () = default; |
7363 | 1653 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1654 bool is_on () const { return is ("on"); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1655 |
7363 | 1656 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
|
1657 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1658 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1659 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1660 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1661 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1662 base_property * clone () const { return new bool_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1663 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1664 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1665 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
|
1666 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1667 if (val.is_bool_scalar ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1668 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
|
1669 else |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1670 return radio_property::do_set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1671 } |
7363 | 1672 }; |
1673 | |
1674 // --------------------------------------------------------------------- | |
1675 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1676 class OCTINTERP_API handle_property : public base_property |
7363 | 1677 { |
1678 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1679 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1680 handle_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1681 |
7364 | 1682 handle_property (const std::string& nm, const graphics_handle& h, |
7363 | 1683 const graphics_handle& val = graphics_handle ()) |
7364 | 1684 : 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
|
1685 m_current_val (val) { } |
7363 | 1686 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1687 handle_property (const handle_property&) = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1688 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1689 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1690 handle_property& operator = (const handle_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1691 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1692 ~handle_property () = 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
|
1693 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1694 octave_value get () const { return m_current_val.as_octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1695 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1696 graphics_handle handle_value () const { return m_current_val; } |
7363 | 1697 |
1698 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
|
1699 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1700 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1701 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1702 } |
7363 | 1703 |
1704 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
|
1705 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1706 set (octave_value (h.value ())); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1707 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1708 } |
7363 | 1709 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1710 void invalidate () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1711 { 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
|
1712 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1713 base_property * clone () const { return new handle_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1714 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
1715 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
|
1716 { 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
|
1717 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1718 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1719 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
|
1720 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
|
1721 |
7363 | 1722 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
|
1723 graphics_handle m_current_val; |
7363 | 1724 }; |
1725 | |
1726 // --------------------------------------------------------------------- | |
1727 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1728 class OCTINTERP_API any_property : public base_property |
7363 | 1729 { |
1730 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1731 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1732 any_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1733 |
7364 | 1734 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
|
1735 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
|
1736 : base_property (nm, h), m_data (m) { } |
7363 | 1737 |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1738 OCTAVE_DEFAULT_COPY_MOVE_CTOR (any_property) |
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
1739 OCTAVE_DISABLE_COPY_MOVE_ASGN (any_property) |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1740 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1741 ~any_property () = 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
|
1742 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1743 octave_value get () const { return m_data; } |
7363 | 1744 |
1745 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
|
1746 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1747 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1748 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1749 } |
7363 | 1750 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1751 base_property * clone () const { return new any_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1752 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1753 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1754 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
|
1755 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1756 m_data = v; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1757 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1758 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1759 |
7363 | 1760 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
|
1761 octave_value m_data; |
7363 | 1762 }; |
1763 | |
1764 // --------------------------------------------------------------------- | |
1765 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1766 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
|
1767 { |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1768 public: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1769 children_property () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1770 : 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
|
1771 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1772 do_init_children (Matrix ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1773 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1774 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1775 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
|
1776 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
|
1777 : 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
|
1778 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1779 do_init_children (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1780 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1781 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1782 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
|
1783 : 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
|
1784 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1785 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
|
1786 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1787 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1788 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
|
1789 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1790 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1791 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1792 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1793 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1794 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1795 children_property& operator = (const children_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1796 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1797 ~children_property () = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1798 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1799 base_property * clone () 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
|
1800 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1801 bool remove_child (double val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1802 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1803 return do_remove_child (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1804 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1805 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1806 void adopt (double val) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1807 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1808 do_adopt_child (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1809 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1810 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1811 Matrix get_children () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1812 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1813 return do_get_children (false); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1814 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1815 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1816 Matrix get_hidden () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1817 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1818 return do_get_children (true); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1819 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1820 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1821 Matrix get_all () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1822 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1823 return do_get_all_children (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1824 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1825 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1826 octave_value get () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1827 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1828 return octave_value (get_children ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1829 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1830 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
1831 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
|
1832 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1833 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
|
1834 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1835 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
1836 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
|
1837 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1838 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
|
1839 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1840 if (hchild == old_gh) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1841 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1842 hchild = new_gh.value (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1843 return; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1844 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1845 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1846 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1847 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
|
1848 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
1849 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1850 private: |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1851 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
|
1852 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
|
1853 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
|
1854 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1855 protected: |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1856 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
|
1857 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1858 Matrix new_kids; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1859 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1860 try |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1861 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1862 new_kids = val.matrix_value (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1863 } |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
1864 catch (octave::execution_exception& ee) |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1865 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
29015
diff
changeset
|
1866 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
|
1867 } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1868 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1869 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
|
1870 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1871 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
|
1872 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1873 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
|
1874 bool add_hidden = true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1875 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1876 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
|
1877 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
|
1878 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1879 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
|
1880 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1881 Matrix t1 = visible_kids.sort (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1882 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
|
1883 Matrix t3 = hidden_kids.sort (); |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1884 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1885 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
|
1886 is_ok = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1887 |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1888 if (t1 == t3) |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1889 add_hidden = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1890 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1891 else |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1892 is_ok = false; |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1893 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
1894 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
|
1895 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
|
1896 "children with visible handles"); |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1897 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1898 m_children_list.clear (); |
26383
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1899 |
5455de7c8566
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26376
diff
changeset
|
1900 // 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
|
1901 // 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
|
1902 // 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
|
1903 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
|
1904 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
|
1905 |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1906 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
|
1907 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
|
1908 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
|
1909 |
5ea5fe592a9a
Don't delete labels when reordering of axes children (bug #63117)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
31238
diff
changeset
|
1910 return true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1911 } |
11175
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 private: |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1914 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
|
1915 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1916 m_children_list.clear (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1917 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
|
1918 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
|
1919 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1920 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1921 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
|
1922 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1923 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
|
1924 m_children_list = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1925 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1926 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1927 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
|
1928 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1929 Matrix do_get_all_children () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1930 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1931 Matrix retval (m_children_list.size (), 1); |
21568
3d60ed163b70
maint: Eliminate bad spacing around '='.
Rik <rik@octave.org>
parents:
21562
diff
changeset
|
1932 octave_idx_type i = 0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1933 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1934 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
|
1935 retval(i++) = hchild; |
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1936 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1937 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1938 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1939 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1940 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
|
1941 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1942 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
|
1943 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
1944 if (*it == child) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1945 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1946 m_children_list.erase (it); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1947 return true; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1948 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1949 } |
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 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1952 |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
1953 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
|
1954 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
1955 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
|
1956 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
1957 |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
1958 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
|
1959 }; |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1960 |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1961 // --------------------------------------------------------------------- |
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
1962 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
1963 class OCTINTERP_API callback_property : public base_property |
7363 | 1964 { |
1965 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1966 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1967 callback_property () = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1968 |
7364 | 1969 callback_property (const std::string& nm, const graphics_handle& h, |
7363 | 1970 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
|
1971 : base_property (nm, h), m_callback (m) { } |
7363 | 1972 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1973 callback_property (const callback_property&) = default; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1974 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1975 // FIXME: should we define assignment? |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1976 callback_property& operator = (const callback_property&) = delete; |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1977 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
1978 ~callback_property () = 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
|
1979 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1980 octave_value get () const { return m_callback; } |
7363 | 1981 |
7367 | 1982 OCTINTERP_API void execute (const octave_value& data = octave_value ()) const; |
7363 | 1983 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1984 bool is_defined () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1985 { |
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_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
|
1987 } |
10517 | 1988 |
7363 | 1989 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
|
1990 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1991 set (val); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1992 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1993 } |
7363 | 1994 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
1995 base_property * clone () const { return new callback_property (*this); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
1996 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
1997 protected: |
8063
41bc700ff642
Trigger actions/listeners only for actual property change
Michael Goffioul
parents:
8061
diff
changeset
|
1998 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
|
1999 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2000 if (! validate (v)) |
23803
90689bdbe048
Use C++11 raw string literals to avoid escaping double quotes.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
2001 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
|
2002 get_name ().c_str ()); |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2003 |
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 m_callback = v; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2005 return true; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2006 return false; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2007 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2008 |
7363 | 2009 private: |
2010 OCTINTERP_API bool validate (const octave_value& v) const; | |
2011 | |
2012 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
|
2013 octave_value m_callback; |
7363 | 2014 }; |
2015 | |
2016 // --------------------------------------------------------------------- | |
2017 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2018 class OCTINTERP_API property |
7363 | 2019 { |
2020 public: | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2021 property () : 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
|
2022 { } |
7363 | 2023 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2024 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
|
2025 { 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
|
2026 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2027 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
|
2028 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2029 m_rep->m_count++; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2030 } |
7363 | 2031 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2032 ~property () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2033 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2034 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
|
2035 delete m_rep; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2036 } |
7363 | 2037 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2038 bool ok () 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
|
2039 { return m_rep->ok (); } |
7363 | 2040 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2041 std::string get_name () 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
|
2042 { return m_rep->get_name (); } |
7363 | 2043 |
2044 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
|
2045 { m_rep->set_name (name); } |
7363 | 2046 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2047 graphics_handle get_parent () 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
|
2048 { return m_rep->get_parent (); } |
7363 | 2049 |
2050 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
|
2051 { m_rep->set_parent (h); } |
7363 | 2052 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2053 bool is_hidden () 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
|
2054 { return m_rep->is_hidden (); } |
7363 | 2055 |
2056 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
|
2057 { m_rep->set_hidden (flag); } |
7363 | 2058 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2059 bool is_radio () 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
|
2060 { return m_rep->is_radio (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2061 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2062 int get_id () 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
|
2063 { return m_rep->get_id (); } |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2064 |
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2065 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
|
2066 { m_rep->set_id (d); } |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
2067 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2068 octave_value get () 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
|
2069 { return m_rep->get (); } |
7363 | 2070 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2071 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
|
2072 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
|
2073 { return m_rep->set (val, do_run, do_notify_toolkit); } |
7363 | 2074 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2075 std::string values_as_string () 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 m_rep->values_as_string (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2077 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2078 Cell values_as_cell () 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
|
2079 { return m_rep->values_as_cell (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2080 |
7363 | 2081 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
|
2082 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2083 *m_rep = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2084 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2085 } |
7363 | 2086 |
2087 property& operator = (const property& p) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2088 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2089 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
|
2090 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
|
2091 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2092 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
|
2093 m_rep->m_count++; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2094 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2095 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2096 } |
7363 | 2097 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2098 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
|
2099 { 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
|
2100 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2101 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
|
2102 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
|
2103 { 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
|
2104 |
27320
1dfd6ae74fbf
use GCB_ prefix for global listener_mode enum names
John W. Eaton <jwe@octave.org>
parents:
27099
diff
changeset
|
2105 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
|
2106 { m_rep->run_listeners (mode); } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2107 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2108 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
|
2109 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
|
2110 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
|
2111 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2112 property clone () 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
|
2113 { return property (m_rep->clone ()); } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2114 |
7363 | 2115 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
|
2116 base_property *m_rep; |
7363 | 2117 }; |
2118 | |
2119 // --------------------------------------------------------------------- | |
2120 | |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
2121 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
|
2122 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2123 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
|
2124 { |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2125 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
|
2126 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
|
2127 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2128 const_iterator it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2129 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2130 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
|
2131 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
|
2132 return it; |
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 (*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
|
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 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
|
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; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2140 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2141 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
|
2142 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
|
2143 return it; |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2144 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2145 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
|
2146 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2147 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2148 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
|
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 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
|
2151 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2152 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
|
2153 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2154 if (it != (*this).end ()) |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2155 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
|
2156 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2157 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
|
2158 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2159 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2160 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
|
2161 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2162 iterator it = find (pname); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2163 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2164 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
|
2165 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2166 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
|
2167 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
|
2168 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2169 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2170 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
|
2171 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2172 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2173 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
|
2174 { |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2175 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
|
2176 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
|
2177 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
|
2178 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2179 |
19086
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2180 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
|
2181 { |
21880
a6952c880cec
maint: Use 'auto' in graphics.cc, graphics.in.h files.
Rik <rik@octave.org>
parents:
21824
diff
changeset
|
2182 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
|
2183 } |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2184 |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2185 }; |
dc88c5784f74
Respect the order in which default graphics properties are set (bug #38449)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19047
diff
changeset
|
2186 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2187 class OCTINTERP_API property_list |
7363 | 2188 { |
2189 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
|
2190 typedef pval_vector pval_map_type; |
7363 | 2191 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
|
2192 |
7363 | 2193 typedef pval_map_type::iterator pval_map_iterator; |
2194 typedef pval_map_type::const_iterator pval_map_const_iterator; | |
2195 | |
2196 typedef plist_map_type::iterator plist_map_iterator; | |
2197 typedef plist_map_type::const_iterator plist_map_const_iterator; | |
2198 | |
2199 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
|
2200 : m_plist_map (m) { } |
7363 | 2201 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
2202 OCTAVE_DEFAULT_COPY_MOVE_DELETE (property_list) |
7363 | 2203 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2204 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
|
2205 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2206 OCTINTERP_API octave_value lookup (const caseless_str& name) const; |
7363 | 2207 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2208 plist_map_iterator begin () { return m_plist_map.begin (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2209 plist_map_const_iterator begin () const { return m_plist_map.begin (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2210 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2211 plist_map_iterator end () { return m_plist_map.end (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2212 plist_map_const_iterator end () const { return m_plist_map.end (); } |
7363 | 2213 |
2214 plist_map_iterator find (const std::string& go_name) | |
2215 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2216 return m_plist_map.find (go_name); |
7363 | 2217 } |
2218 | |
2219 plist_map_const_iterator find (const std::string& go_name) const | |
2220 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2221 return m_plist_map.find (go_name); |
7363 | 2222 } |
2223 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2224 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
|
2225 as_struct (const std::string& prefix_arg) const; |
7363 | 2226 |
2227 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
|
2228 plist_map_type m_plist_map; |
7363 | 2229 }; |
2230 | |
2231 // --------------------------------------------------------------------- | |
2232 | |
6874 | 2233 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
|
2234 class graphics_object; |
6874 | 2235 |
7365 | 2236 class OCTINTERP_API base_properties |
6874 | 2237 { |
2238 public: | |
7176 | 2239 base_properties (const std::string& ty = "unknown", |
7363 | 2240 const graphics_handle& mh = graphics_handle (), |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2241 const graphics_handle& p = graphics_handle ()); |
6874 | 2242 |
31883
56809fe23e53
eliminate some clang warnings about defaulted functions being deleted
John W. Eaton <jwe@octave.org>
parents:
31855
diff
changeset
|
2243 OCTAVE_DISABLE_COPY_MOVE (base_properties) |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
2244 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2245 virtual ~base_properties () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2246 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2247 virtual std::string graphics_object_name () const { return "unknown"; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2248 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2249 OCTINTERP_API void mark_modified (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2250 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2251 OCTINTERP_API void override_defaults (base_graphics_object& obj); |
6874 | 2252 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2253 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
|
2254 { |
33382
79cfa1b7a813
replace nearly all remaining uses of panic_impossible with error
John W. Eaton <jwe@octave.org>
parents:
33128
diff
changeset
|
2255 error ("unexpected call to base_properties::init_integerhandle - please report this bug"); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2256 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2257 |
6874 | 2258 // Look through DEFAULTS for properties with given CLASS_NAME, and |
2259 // apply them to the current object with set (virtual method). | |
2260 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2261 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
|
2262 set_from_list (base_graphics_object& obj, property_list& defaults); |
6874 | 2263 |
7363 | 2264 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
|
2265 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2266 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
|
2267 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
|
2268 m_all_props[name] = p; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2269 } |
7363 | 2270 |
9972 | 2271 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
|
2272 |
1e5c11890f85
check for invalid property names when setting defaults
John W. Eaton <jwe@octave.org>
parents:
9004
diff
changeset
|
2273 virtual octave_value get (const caseless_str& pname) const; |
7363 | 2274 |
9616
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2275 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
|
2276 { |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2277 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
|
2278 } |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2279 |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2280 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
|
2281 { |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2282 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
|
2283 } |
2093499ec9f4
avoid crash if default font can't be found
John W. Eaton <jwe@octave.org>
parents:
9585
diff
changeset
|
2284 |
7379 | 2285 virtual octave_value get (bool all = false) const; |
7363 | 2286 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2287 // 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
|
2288 // 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
|
2289 // 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
|
2290 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
|
2291 |
9585
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2292 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
|
2293 { |
33382
79cfa1b7a813
replace nearly all remaining uses of panic_impossible with error
John W. Eaton <jwe@octave.org>
parents:
33128
diff
changeset
|
2294 error ("unexpected call to base_properties::has_property - please report this bug"); |
79cfa1b7a813
replace nearly all remaining uses of panic_impossible with error
John W. Eaton <jwe@octave.org>
parents:
33128
diff
changeset
|
2295 |
9585
06b8b51dca48
also handle user-defined graphics properties in new property name validation scheme
John W. Eaton <jwe@octave.org>
parents:
9582
diff
changeset
|
2296 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
|
2297 } |
7864
56f781f38f0b
Add dynamic property creation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7862
diff
changeset
|
2298 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2299 bool is_modified () const { return is___modified__ (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2300 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2301 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
|
2302 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2303 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
|
2304 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2305 m_children.run_listeners (); |
26982
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2306 mark_modified (); |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2307 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2308 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2309 |
7386 | 2310 virtual void adopt (const graphics_handle& h) |
6874 | 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 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
|
2313 m_children.run_listeners (); |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
2314 mark_modified (); |
6874 | 2315 } |
2316 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2317 virtual octave::graphics_toolkit get_toolkit () const; |
7419 | 2318 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2319 virtual Matrix |
20946 | 2320 get_boundingbox (bool /* finternal */ = false, |
2321 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
|
2322 { return Matrix (1, 4, 0.0); } |
7447 | 2323 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2324 virtual void update_boundingbox (); |
7828
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
2325 |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
2326 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
|
2327 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2328 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
|
2329 listener_mode = GCB_POSTSET); |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2330 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2331 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
|
2332 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
|
2333 |
27698
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2334 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
|
2335 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2336 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
|
2337 update_beingdeleted (); |
27698
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2338 } |
f65b1666e650
don't notify toolkit when setting beingdeleted property (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27682
diff
changeset
|
2339 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2340 void set_tag (const octave_value& val) { m_tag = val; } |
7176 | 2341 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2342 OCTINTERP_API void set_parent (const octave_value& val); |
6874 | 2343 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2344 Matrix get_children () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2345 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2346 return m_children.get_children (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2347 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2348 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2349 Matrix get_all_children () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2350 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2351 return m_children.get_all (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2352 } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2353 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2354 Matrix get_hidden_children () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2355 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2356 return m_children.get_hidden (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2357 } |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2358 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2359 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
|
2360 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
|
2361 bool traverse, |
32589
05b4479c29d8
maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents:
32116
diff
changeset
|
2362 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
|
2363 |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2364 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
|
2365 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2366 void set___modified__ (const octave_value& val) { m___modified__ = val; } |
7366 | 2367 |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2368 // 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
|
2369 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2370 graphics_handle get_uicontextmenu () const |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2371 { |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2372 return get_contextmenu (); |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2373 } |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2374 |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2375 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
|
2376 { |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2377 set_contextmenu (val); |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2378 } |
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
2379 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2380 void reparent (const graphics_handle& new_parent) { m_parent = new_parent; } |
6874 | 2381 |
7214 | 2382 // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent |
2383 // axes object. | |
2384 | |
7386 | 2385 virtual void update_axis_limits (const std::string& axis_type) const; |
7214 | 2386 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2387 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
|
2388 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
|
2389 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2390 virtual void update_contextmenu () const; |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
2391 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2392 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
|
2393 { |
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 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
|
2395 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2396 |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2397 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
|
2398 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2399 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
|
2400 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2401 |
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2402 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
|
2403 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2404 m_parent = new_gh; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2405 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
2406 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2407 static OCTINTERP_API property_list::pval_map_type factory_defaults (); |
7222 | 2408 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
2409 // 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
|
2410 // genprops.awk script. |
7222 | 2411 // |
2412 // 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
|
2413 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2414 virtual octave_value get_alim () const { return octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2415 virtual octave_value get_clim () const { return octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2416 virtual octave_value get_xlim () const { return octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2417 virtual octave_value get_ylim () const { return octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2418 virtual octave_value get_zlim () const { return octave_value (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2419 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2420 virtual bool is_aliminclude () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2421 virtual bool is_climinclude () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2422 virtual bool is_xliminclude () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2423 virtual bool is_yliminclude () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2424 virtual bool is_zliminclude () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2425 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2426 OCTINTERP_API bool is_handle_visible () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2427 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2428 OCTINTERP_API std::set<std::string> dynamic_property_names () const; |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2429 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2430 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
|
2431 |
6874 | 2432 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
|
2433 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
|
2434 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2435 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
|
2436 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
|
2437 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2438 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
|
2439 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2440 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
|
2441 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2442 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
|
2443 |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2444 BEGIN_BASE_PROPERTIES |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2445 // 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
|
2446 bool_property beingdeleted s , "off" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2447 radio_property busyaction , "{queue}|cancel" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2448 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
|
2449 children_property children gf , Matrix () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2450 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
|
2451 handle_property contextmenu u , graphics_handle () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2452 callback_property createfcn , Matrix () |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2453 callback_property deletefcn , Matrix () |
24395
41cf6ee90cb6
Better handling of "handlevisibility" property (bug #52621).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24277
diff
changeset
|
2454 radio_property handlevisibility u , "{on}|callback|off" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2455 bool_property hittest , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2456 bool_property interruptible , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2457 handle_property parent fs , p |
24523
501986e12b8b
Implement "pickableparts" property (bug #52795).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24501
diff
changeset
|
2458 radio_property pickableparts , "{visible}|all|none" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2459 bool_property selected , "off" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2460 bool_property selectionhighlight , "on" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2461 string_property tag s , "" |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2462 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
|
2463 handle_property uicontextmenu gsh , graphics_handle () |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2464 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
|
2465 bool_property visible u , "on" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2466 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
2467 // Octave-specific properties |
27682
e18237114cf8
Hide __appdata__ internal property (bug #57211).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
27446
diff
changeset
|
2468 any_property __appdata__ h , Matrix () |
22665
4ea5b0c3b10f
Make base graphics property __modified__ hidden (bug #49205).
Rik <rik@octave.org>
parents:
22631
diff
changeset
|
2469 bool_property __modified__ hs , "on" |
8061
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2470 graphics_handle __myhandle__ fhrs , mh |
f819e8992367
Auto-generate base_properties
John W. Eaton <jwe@octave.org>
parents:
8059
diff
changeset
|
2471 END_PROPERTIES |
7363 | 2472 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2473 virtual void update_beingdeleted () { }; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2474 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2475 virtual void update_handlevisibility (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2476 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2477 virtual void update_visible () { }; |
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
|
2478 |
7363 | 2479 protected: |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2480 struct cmp_caseless_str |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2481 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
30053
diff
changeset
|
2482 public: |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
2483 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
|
2484 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2485 std::string a1 = a; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2486 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
|
2487 std::string b1 = b; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2488 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
|
2489 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2490 return a1 < b1; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2491 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2492 }; |
8052
961d4c52ffae
Convert stem and stem3 to use stem series objects
David Bateman <dbateman@free.fr>
parents:
8023
diff
changeset
|
2493 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2494 std::map<caseless_str, property, cmp_caseless_str> m_all_props; |
7363 | 2495 |
2496 protected: | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2497 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2498 virtual void init () |
22910
23847979b91e
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
2499 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2500 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
|
2501 } |
6874 | 2502 }; |
2503 | |
7365 | 2504 class OCTINTERP_API base_graphics_object |
6874 | 2505 { |
2506 public: | |
2507 friend class graphics_object; | |
2508 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2509 base_graphics_object () : m_toolkit_flag (false) { } |
6874 | 2510 |
31837
febd82d1a8de
use new macros to consistently delete copy and move member functions
John W. Eaton <jwe@octave.org>
parents:
31827
diff
changeset
|
2511 OCTAVE_DISABLE_COPY_MOVE (base_graphics_object) |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
2512 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2513 virtual ~base_graphics_object () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2514 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2515 virtual void mark_modified () |
6874 | 2516 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2517 if (! valid_object ()) |
7386 | 2518 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
|
2519 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2520 get_properties ().mark_modified (); |
6874 | 2521 } |
2522 | |
7386 | 2523 virtual void override_defaults (base_graphics_object& obj) |
6874 | 2524 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2525 if (! valid_object ()) |
7386 | 2526 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
|
2527 get_properties ().override_defaults (obj); |
6874 | 2528 } |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2529 |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23401
diff
changeset
|
2530 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
|
2531 const std::string go_name) const; |
6874 | 2532 |
7386 | 2533 virtual void set_from_list (property_list& plist) |
6874 | 2534 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2535 if (! valid_object ()) |
7386 | 2536 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
|
2537 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2538 get_properties ().set_from_list (*this, plist); |
6874 | 2539 } |
2540 | |
7386 | 2541 virtual void set (const caseless_str& pname, const octave_value& pval) |
6874 | 2542 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2543 if (! valid_object ()) |
7386 | 2544 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
|
2545 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2546 get_properties ().set (pname, pval); |
6874 | 2547 } |
2548 | |
2549 virtual void set_defaults (const std::string&) | |
2550 { | |
2551 error ("base_graphics_object::set_defaults: invalid graphics object"); | |
2552 } | |
2553 | |
26918
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2554 // 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
|
2555 // because no derived class overrides it. |
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2556 |
0a13d8d19790
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26879
diff
changeset
|
2557 octave_value get (bool all = false) const |
6874 | 2558 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2559 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2560 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
|
2561 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2562 return get_properties ().get (all); |
6874 | 2563 } |
2564 | |
7386 | 2565 virtual octave_value get (const caseless_str& pname) const |
6874 | 2566 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2567 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2568 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
|
2569 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2570 return get_properties ().get (pname); |
6874 | 2571 } |
2572 | |
7189 | 2573 virtual octave_value get_default (const caseless_str&) const; |
6874 | 2574 |
7189 | 2575 virtual octave_value get_factory_default (const caseless_str&) const; |
6874 | 2576 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2577 virtual octave_value get_defaults () const |
6874 | 2578 { |
2579 error ("base_graphics_object::get_defaults: invalid graphics object"); | |
2580 } | |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
2581 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2582 virtual property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2583 { |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2584 if (! valid_object ()) |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2585 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
|
2586 |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2587 return property_list (); |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2588 } |
6874 | 2589 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2590 virtual octave_value get_factory_defaults () const |
6874 | 2591 { |
2592 error ("base_graphics_object::get_factory_defaults: invalid graphics object"); | |
2593 } | |
2594 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2595 virtual property_list get_factory_defaults_list () const |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2596 { |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2597 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
|
2598 } |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2599 |
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
|
2600 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
|
2601 { |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2602 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
|
2603 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2604 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2605 // 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
|
2606 // currently not possible. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2607 virtual std::string values_as_string (); |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2608 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2609 // 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
|
2610 // currently not possible. |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
2611 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
|
2612 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2613 // 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
|
2614 // currently not possible. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2615 virtual octave_scalar_map values_as_struct (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2616 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2617 virtual graphics_handle get_parent () const |
6874 | 2618 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2619 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2620 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
|
2621 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2622 return get_properties ().get_parent (); |
6874 | 2623 } |
2624 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2625 graphics_handle get_handle () const |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2626 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2627 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2628 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
|
2629 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2630 return get_properties ().get___myhandle__ (); |
7936
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2631 } |
78400fde223e
Support for backend-to-octave event management
John W. Eaton <jwe@octave.org>
parents:
7902
diff
changeset
|
2632 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
2633 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
|
2634 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2635 if (! valid_object ()) |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2636 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
|
2637 |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2638 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
|
2639 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
2640 |
7386 | 2641 virtual void adopt (const graphics_handle& h) |
6874 | 2642 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2643 if (! valid_object ()) |
7386 | 2644 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
|
2645 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2646 get_properties ().adopt (h); |
6874 | 2647 } |
2648 | |
7386 | 2649 virtual void reparent (const graphics_handle& np) |
6874 | 2650 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2651 if (! valid_object ()) |
7386 | 2652 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
|
2653 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2654 get_properties ().reparent (np); |
6874 | 2655 } |
2656 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2657 virtual void defaults () const |
6874 | 2658 { |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2659 if (! valid_object ()) |
7386 | 2660 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
|
2661 |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20956
diff
changeset
|
2662 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
|
2663 err_not_implemented (msg.c_str ()); |
6874 | 2664 } |
2665 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2666 virtual base_properties& get_properties () |
6874 | 2667 { |
2668 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
|
2669 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
|
2670 return properties; |
6874 | 2671 } |
2672 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2673 virtual const base_properties& get_properties () const |
7222 | 2674 { |
2675 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
|
2676 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
|
2677 return properties; |
7222 | 2678 } |
2679 | |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
2680 virtual void update_axis_limits (const std::string& axis_type); |
7214 | 2681 |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2682 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
|
2683 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
|
2684 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2685 virtual bool valid_object () const { return false; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2686 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2687 bool valid_toolkit_object () const { return m_toolkit_flag; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2688 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2689 virtual std::string type () const |
7386 | 2690 { |
2691 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
|
2692 : "unknown"); |
7386 | 2693 } |
6874 | 2694 |
2695 bool isa (const std::string& go_name) const | |
2696 { | |
2697 return type () == go_name; | |
2698 } | |
2699 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2700 virtual octave::graphics_toolkit get_toolkit () const |
7419 | 2701 { |
20976
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2702 if (! valid_object ()) |
20956
850e3d2533d4
maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
2703 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
|
2704 |
0fd972b06a6f
maint: graphics.in.h: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
2705 return get_properties ().get_toolkit (); |
7419 | 2706 } |
2707 | |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2708 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
|
2709 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
|
2710 listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2711 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2712 if (valid_object ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2713 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
|
2714 } |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2715 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2716 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
|
2717 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
|
2718 listener_mode mode = GCB_POSTSET) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2719 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2720 if (valid_object ()) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2721 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
|
2722 } |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2723 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2724 virtual void remove_all_listeners (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2725 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2726 virtual void reset_default_properties (); |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
2727 |
6874 | 2728 protected: |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2729 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
|
2730 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2731 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
|
2732 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
|
2733 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2734 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2735 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
|
2736 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2737 if (m_toolkit_flag) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2738 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2739 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
|
2740 m_toolkit_flag = false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2741 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2742 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2743 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2744 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
|
2745 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2746 if (m_toolkit_flag) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2747 get_toolkit ().update (go, id); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2748 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2749 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2750 protected: |
12164
18e9a8da7d18
eliminate some -Weffc++ warnings
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
12126
diff
changeset
|
2751 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
2752 // 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
|
2753 // 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
|
2754 bool m_toolkit_flag; |
6874 | 2755 }; |
2756 | |
7365 | 2757 class OCTINTERP_API graphics_object |
6874 | 2758 { |
2759 public: | |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2760 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2761 graphics_object () : m_rep (new base_graphics_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
|
2762 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2763 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
|
2764 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
2765 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
|
2766 |
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
2767 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
|
2768 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2769 ~graphics_object () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2770 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2771 void mark_modified () { m_rep->mark_modified (); } |
6874 | 2772 |
2773 void override_defaults (base_graphics_object& obj) | |
2774 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2775 m_rep->override_defaults (obj); |
6874 | 2776 } |
2777 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2778 void override_defaults () |
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
|
2779 { |
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 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
|
2781 } |
10600b2dd3c1
make units other than data work for axes labels and title (bug #35857)
John W. Eaton <jwe@octave.org>
parents:
20045
diff
changeset
|
2782 |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23401
diff
changeset
|
2783 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
|
2784 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
|
2785 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2786 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
|
2787 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2788 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2789 void set_from_list (property_list& plist) { m_rep->set_from_list (plist); } |
6874 | 2790 |
7189 | 2791 void set (const caseless_str& name, const octave_value& val) |
6874 | 2792 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2793 m_rep->set (name, val); |
6874 | 2794 } |
2795 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2796 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
|
2797 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2798 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
|
2799 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
|
2800 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2801 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
|
2802 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2803 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
|
2804 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
|
2805 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2806 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
|
2807 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2808 octave_value get (bool all = false) const { return m_rep->get (all); } |
6874 | 2809 |
7189 | 2810 octave_value get (const caseless_str& name) const |
6874 | 2811 { |
2812 return name.compare ("default") | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2813 ? get_defaults () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
2814 : (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
|
2815 ? get_factory_defaults () : m_rep->get (name)); |
6874 | 2816 } |
2817 | |
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
|
2818 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
|
2819 { |
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
|
2820 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
|
2821 } |
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
|
2822 |
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
|
2823 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
|
2824 { |
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
|
2825 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
|
2826 } |
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
|
2827 |
7189 | 2828 octave_value get_default (const caseless_str& name) const |
6874 | 2829 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2830 return m_rep->get_default (name); |
6874 | 2831 } |
2832 | |
7189 | 2833 octave_value get_factory_default (const caseless_str& name) const |
6874 | 2834 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2835 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
|
2836 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2837 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2838 octave_value get_defaults () const { return m_rep->get_defaults (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2839 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2840 property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2841 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2842 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
|
2843 } |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
2844 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2845 octave_value get_factory_defaults () const |
6874 | 2846 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2847 return m_rep->get_factory_defaults (); |
6874 | 2848 } |
2849 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2850 property_list get_factory_defaults_list () const |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2851 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2852 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
|
2853 } |
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
2854 |
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
|
2855 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
|
2856 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2857 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
|
2858 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
2859 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2860 // 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
|
2861 // currently not possible. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2862 std::string values_as_string () { return m_rep->values_as_string (); } |
10717
9d4a198614ab
Add functionality set(handle)
David Bateman <dbateman@free.fr>
parents:
10596
diff
changeset
|
2863 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2864 // 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
|
2865 // currently not possible. |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
2866 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
|
2867 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2868 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
|
2869 } |
ca84d3c9dc24
set: allow retrieving allowed values for individual properties
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
17822
diff
changeset
|
2870 |
28346
d0555f415774
fix constness of some graphics properties methods
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
2871 // 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
|
2872 // currently not possible. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2873 octave_map values_as_struct () { return m_rep->values_as_struct (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2874 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2875 graphics_handle get_parent () const { return m_rep->get_parent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2876 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2877 graphics_handle get_handle () 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
|
2878 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2879 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
|
2880 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2881 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
|
2882 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2883 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
|
2884 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2885 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
|
2886 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2887 void defaults () const { m_rep->defaults (); } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2888 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2889 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
|
2890 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2891 base_properties& get_properties () { return m_rep->get_properties (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2892 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2893 const base_properties& get_properties () const |
7222 | 2894 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2895 return m_rep->get_properties (); |
7222 | 2896 } |
2897 | |
7214 | 2898 void update_axis_limits (const std::string& axis_type) |
2899 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2900 m_rep->update_axis_limits (axis_type); |
7214 | 2901 } |
2902 | |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
2903 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
|
2904 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
|
2905 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2906 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
|
2907 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2908 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2909 bool valid_object () const { return m_rep->valid_object (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2910 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2911 std::string type () const { return m_rep->type (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2912 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2913 operator bool () const { return m_rep->valid_object (); } |
6874 | 2914 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
2915 // 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
|
2916 // genprops.awk script. |
7222 | 2917 // |
2918 // 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
|
2919 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2920 octave_value get_alim () const |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2921 { return get_properties ().get_alim (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2922 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2923 octave_value get_clim () const |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2924 { return get_properties ().get_clim (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2925 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2926 octave_value get_xlim () 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
|
2927 { 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
|
2928 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2929 octave_value get_ylim () 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
|
2930 { return get_properties ().get_ylim (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2931 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2932 octave_value get_zlim () 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
|
2933 { return get_properties ().get_zlim (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2934 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2935 bool is_aliminclude () const |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2936 { return get_properties ().is_aliminclude (); } |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2937 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2938 bool is_climinclude () const |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
2939 { 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
|
2940 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2941 bool is_xliminclude () 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
|
2942 { return get_properties ().is_xliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2943 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2944 bool is_yliminclude () 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
|
2945 { return get_properties ().is_yliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2946 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2947 bool is_zliminclude () 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
|
2948 { return get_properties ().is_zliminclude (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2949 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2950 bool is_handle_visible () const |
8249 | 2951 { return get_properties ().is_handle_visible (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
2952 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2953 octave::graphics_toolkit get_toolkit () 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
|
2954 { return m_rep->get_toolkit (); } |
7408 | 2955 |
7849
3249f64f69b2
Initial low-level support for property listeners.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7848
diff
changeset
|
2956 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
|
2957 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
|
2958 { 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
|
2959 |
8299
be9b14945774
Add code to remove listeners from properties and use it with newplot
David Bateman <dbateman@free.fr>
parents:
8291
diff
changeset
|
2960 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
|
2961 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
|
2962 { 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
|
2963 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2964 void remove_all_listeners () { m_rep->remove_all_listeners (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2965 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2966 void initialize () { m_rep->initialize (*this); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2967 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2968 void finalize () { m_rep->finalize (*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
|
2969 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2970 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
|
2971 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
2972 void reset_default_properties () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2973 { m_rep->reset_default_properties (); } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
2974 |
7408 | 2975 private: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
2976 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
2977 std::shared_ptr<base_graphics_object> m_rep; |
7408 | 2978 }; |
2979 | |
2980 // --------------------------------------------------------------------- | |
2981 | |
7365 | 2982 class OCTINTERP_API root_figure : public base_graphics_object |
6874 | 2983 { |
2984 public: | |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2985 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2986 // 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
|
2987 // the root_figure object. |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2988 |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2989 friend class gh_manager; |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
2990 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
2991 class OCTINTERP_API properties : public base_properties |
6874 | 2992 { |
2993 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2994 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
|
2995 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
|
2996 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
2997 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
|
2998 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
|
2999 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
|
3000 |
6874 | 3001 // See the genprops.awk script for an explanation of the |
3002 // properties declarations. | |
3003 | |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3004 // 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
|
3005 // monitorpositions, pointerlocation, pointerwindow. |
18764
89448a7523b2
Add some more callbacks for root properties (bug #42347).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18737
diff
changeset
|
3006 // 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
|
3007 // them will have no effect. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3008 |
20459
564e59f75ef8
Remove obsolete properties from root figure object.
Rik <rik@octave.org>
parents:
20428
diff
changeset
|
3009 // 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
|
3010 // 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
|
3011 // 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
|
3012 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3013 // Programming note: Keep property list sorted if new ones are added. |
9778 | 3014 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
3015 BEGIN_PROPERTIES (root_figure, root) |
9778 | 3016 handle_property callbackobject Sr , graphics_handle () |
3017 array_property commandwindowsize r , Matrix (1, 2, 0) | |
7363 | 3018 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
|
3019 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
|
3020 array_property monitorpositions r , default_screensize () |
10949
848f3a13b7cf
Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents:
10948
diff
changeset
|
3021 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
|
3022 double_property pointerwindow r , 0.0 |
8560
5cc594679cdc
get display characteristics from system
John W. Eaton <jwe@octave.org>
parents:
8465
diff
changeset
|
3023 double_property screendepth r , default_screendepth () |
9778 | 3024 double_property screenpixelsperinch r , default_screenpixelsperinch () |
10949
848f3a13b7cf
Backed out changeset 6b50fd2d4ca6
David Bateman <dbateman@free.fr>
parents:
10948
diff
changeset
|
3025 array_property screensize r , default_screensize () |
9778 | 3026 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
|
3027 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
|
3028 // 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
|
3029 //radio_property beingdeleted h , "{off}|on" |
6874 | 3030 END_PROPERTIES |
3031 }; | |
3032 | |
3033 private: | |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3034 |
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 properties m_properties; |
6874 | 3036 |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3037 protected: |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3038 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3039 root_figure () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3040 : 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
|
3041 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
|
3042 { } |
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3043 |
6874 | 3044 public: |
3045 | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
3046 OCTAVE_DISABLE_COPY_MOVE (root_figure) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
3047 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3048 ~root_figure () = default; |
6874 | 3049 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3050 void mark_modified () { } |
6874 | 3051 |
3052 void override_defaults (base_graphics_object& obj) | |
3053 { | |
3054 // Now override with our defaults. If the default_properties | |
3055 // list includes the properties for all defaults (line, | |
3056 // surface, etc.) then we don't have to know the type of OBJ | |
3057 // here, we just call its set function and let it decide which | |
3058 // 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
|
3059 obj.set_from_list (m_default_properties); |
6874 | 3060 } |
3061 | |
7189 | 3062 void set (const caseless_str& name, const octave_value& value) |
6874 | 3063 { |
3064 if (name.compare ("default", 7)) | |
3065 // strip "default", pass rest to function that will | |
3066 // parse the remainder and add the element to the | |
3067 // 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
|
3068 m_default_properties.set (name.substr (7), value); |
6874 | 3069 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
|
3070 m_properties.set (name, value); |
6874 | 3071 } |
3072 | |
7189 | 3073 octave_value get (const caseless_str& name) const |
6874 | 3074 { |
3075 octave_value retval; | |
3076 | |
3077 if (name.compare ("default", 7)) | |
3078 return get_default (name.substr (7)); | |
3079 else if (name.compare ("factory", 7)) | |
3080 return get_factory_default (name.substr (7)); | |
3081 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
|
3082 retval = m_properties.get (name); |
6874 | 3083 |
3084 return retval; | |
3085 } | |
3086 | |
7189 | 3087 octave_value get_default (const caseless_str& name) const |
6874 | 3088 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3089 octave_value retval = m_default_properties.lookup (name); |
6874 | 3090 |
3091 if (retval.is_undefined ()) | |
7847
40b16e04172a
Make backend switching work.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7846
diff
changeset
|
3092 { |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3093 // 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
|
3094 retval = m_factory_properties.lookup (name); |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3095 |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
3096 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
|
3097 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
|
3098 } |
6874 | 3099 |
3100 return retval; | |
3101 } | |
3102 | |
7189 | 3103 octave_value get_factory_default (const caseless_str& name) const |
6874 | 3104 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3105 octave_value retval = m_factory_properties.lookup (name); |
6874 | 3106 |
3107 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
|
3108 error ("get: invalid factory default property '%s'", name.c_str ()); |
6874 | 3109 |
3110 return retval; | |
3111 } | |
3112 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3113 octave_value get_defaults () const |
6874 | 3114 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3115 return m_default_properties.as_struct ("default"); |
6874 | 3116 } |
3117 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3118 property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3119 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3120 return m_default_properties; |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3121 } |
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3122 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3123 octave_value get_factory_defaults () const |
6874 | 3124 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3125 return m_factory_properties.as_struct ("factory"); |
6874 | 3126 } |
3127 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3128 property_list get_factory_defaults_list () const |
18963
a30e1d20fd3c
Freset: properly reset graphics objects (bug #35511)
pantxo <pantxo.diribarne@gmail.com>
parents:
18961
diff
changeset
|
3129 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3130 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
|
3131 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3132 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3133 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3134 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3135 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3136 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3137 bool valid_object () const { return true; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3138 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3139 OCTINTERP_API void reset_default_properties (); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3140 |
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
|
3141 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
|
3142 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3143 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
|
3144 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
|
3145 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
|
3146 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
|
3147 } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
3148 |
6874 | 3149 private: |
23763
54aa9a3250b4
make root_figure::factory_properties local instead of global
John W. Eaton <jwe@octave.org>
parents:
23639
diff
changeset
|
3150 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3151 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
|
3152 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3153 property_list m_factory_properties; |
6874 | 3154 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3155 static OCTINTERP_API property_list::plist_map_type |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3156 init_factory_properties (); |
6874 | 3157 }; |
3158 | |
3159 // --------------------------------------------------------------------- | |
3160 | |
7365 | 3161 class OCTINTERP_API figure : public base_graphics_object |
6874 | 3162 { |
3163 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3164 |
7445 | 3165 class OCTINTERP_API properties : public base_properties |
6874 | 3166 { |
3167 public: | |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
3168 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
|
3169 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3170 m_integerhandle = val; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3171 } |
13816
7ee18dc46bbb
new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents:
13810
diff
changeset
|
3172 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3173 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
|
3174 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
|
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 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
|
3177 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3178 OCTINTERP_API octave::graphics_toolkit get_toolkit () const; |
29233
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 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
|
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 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
|
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 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
|
3185 |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3186 // Alias "innerposition" to "position". |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3187 octave_value get_innerposition () const |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3188 { |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3189 return get_position (); |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3190 } |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3191 |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3192 void set_innerposition (const octave_value& val) |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3193 { |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3194 set_position (val); |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3195 } |
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3196 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3197 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
|
3198 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
|
3199 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3200 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
|
3201 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
|
3202 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3203 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
|
3204 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3205 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
|
3206 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
|
3207 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
|
3208 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3209 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
|
3210 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
|
3211 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
|
3212 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3213 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
|
3214 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3215 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
|
3216 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3217 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
|
3218 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3219 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
|
3220 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3221 OCTINTERP_API std::string get_title () const; |
8059
75c99d3f97d7
Octave to backend notification scheme
John W. Eaton <jwe@octave.org>
parents:
8058
diff
changeset
|
3222 |
6874 | 3223 // See the genprops.awk script for an explanation of the |
3224 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3225 // Programming note: Keep property list sorted if new ones are added. |
6874 | 3226 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
3227 BEGIN_PROPERTIES (figure) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3228 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
|
3229 callback_property buttondownfcn , Matrix () |
7363 | 3230 callback_property closerequestfcn , "closereq" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3231 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
|
3232 array_property colormap , viridis_colormap () |
7363 | 3233 handle_property currentaxes S , graphics_handle () |
7405 | 3234 string_property currentcharacter r , "" |
3235 handle_property currentobject r , graphics_handle () | |
10517 | 3236 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
|
3237 bool_property dockcontrols , "on" |
11247
29b1f7d68665
make filename property of figure objects writable
John W. Eaton <jwe@octave.org>
parents:
11175
diff
changeset
|
3238 string_property filename , "" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3239 bool_property graphicssmoothing , "on" |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3240 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
|
3241 bool_property integerhandle S , "on" |
21323
030d4d6c2b58
Implement figure property "InvertHardCopy" for printing (bug #47230).
Rik <rik@octave.org>
parents:
21289
diff
changeset
|
3242 bool_property inverthardcopy , "on" |
7405 | 3243 callback_property keypressfcn , Matrix () |
3244 callback_property keyreleasefcn , Matrix () | |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3245 radio_property menubar , "{figure}|none" |
7405 | 3246 string_property name , "" |
25273
ac6ba9f2fa41
Add new Figure graphic property "Number" (bug #53343).
Rik <rik@octave.org>
parents:
25173
diff
changeset
|
3247 array_property number rG , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3248 radio_property nextplot , "{add}|new|replace|replacechildren" |
7405 | 3249 bool_property numbertitle , "on" |
13713
d99aa455296e
Add outerposition property to figure objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13703
diff
changeset
|
3250 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
|
3251 radio_property paperorientation U , "{portrait}|landscape" |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3252 array_property paperposition m , default_figure_paperposition () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3253 // 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
|
3254 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
|
3255 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
|
3256 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
|
3257 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
|
3258 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
|
3259 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
|
3260 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
|
3261 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
|
3262 radio_property renderer m , "{opengl}|painters" |
7405 | 3263 radio_property renderermode , "{auto}|manual" |
3264 bool_property resize , "on" | |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
3265 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
3266 // and has been replaced with "sizechangedfcn" |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3267 // Eventually this will need to be hidden, and then removed. |
7405 | 3268 callback_property resizefcn , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3269 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
|
3270 callback_property sizechangedfcn , Matrix () |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3271 radio_property toolbar , "{auto}|figure|none" |
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3272 radio_property units Su , "{pixels}|normalized|inches|centimeters|points|characters" |
7405 | 3273 callback_property windowbuttondownfcn , Matrix () |
3274 callback_property windowbuttonmotionfcn , Matrix () | |
3275 callback_property windowbuttonupfcn , Matrix () | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3276 callback_property windowkeypressfcn , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3277 callback_property windowkeyreleasefcn , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3278 callback_property windowscrollwheelfcn , Matrix () |
31020
cb9451780a15
Update figure graphics object for Matlab compatibility.
Rik <rik@octave.org>
parents:
30999
diff
changeset
|
3279 radio_property windowstate , "{normal}|minimized|maximized|fullscreen" |
7405 | 3280 radio_property windowstyle , "{normal}|modal|docked" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3281 |
24687
8b935067a257
Allow printing without updating qt visible or invisible figures (bug #52940).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24637
diff
changeset
|
3282 // Overridden base property |
24637
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3283 // 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
|
3284 // 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
|
3285 radio_property pickableparts h , "{visible}" |
3d78a7eb5aa4
Make "PickableParts" property for figures the fixed value of "visible".
Rik <rik@octave.org>
parents:
24635
diff
changeset
|
3286 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3287 // Octave-specific properties |
21684
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3288 mutable string_property __gl_extensions__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3289 mutable string_property __gl_renderer__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3290 mutable string_property __gl_vendor__ hr , "" |
1449e3b98941
store OpenGL version info in figure properties
John W. Eaton <jwe@octave.org>
parents:
21659
diff
changeset
|
3291 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
|
3292 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
|
3293 string_property __graphics_toolkit__ hs , default_graphics_toolkit () |
13699
dd9b32af0a01
Implement guidata/guihandles.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13324
diff
changeset
|
3294 any_property __guidata__ h , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3295 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
|
3296 bool_property __printing__ h , "off" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3297 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
|
3298 any_property __plot_stream__ h , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3299 any_property __rotate_mode__ h , Matrix () |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3300 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
|
3301 double_property __device_pixel_ratio__ hU , 1.0 |
21948
241d39c66e8f
Update graphics properties for figure object.
Rik <rik@octave.org>
parents:
21905
diff
changeset
|
3302 |
6874 | 3303 END_PROPERTIES |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
3304 |
7363 | 3305 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3306 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3307 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3308 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
|
3309 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
|
3310 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
|
3311 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
|
3312 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
|
3313 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
|
3314 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
|
3315 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
|
3316 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
|
3317 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
|
3318 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
|
3319 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
|
3320 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
|
3321 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
|
3322 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
|
3323 |
0a84a7d0998d
don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents:
27698
diff
changeset
|
3324 init_toolkit (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3325 } |
7408 | 3326 |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3327 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3328 OCTINTERP_API Matrix get_auto_paperposition (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3329 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3330 void update_paperpositionmode () |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3331 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3332 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
|
3333 m_paperposition.set (get_auto_paperposition ()); |
18773
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3334 } |
70ea5a2856fe
Handle figure paperpositionmode "auto" (bug #37554)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18766
diff
changeset
|
3335 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3336 OCTINTERP_API void update_handlevisibility (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3337 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3338 OCTINTERP_API void init_toolkit (); |
27709
0a84a7d0998d
don't declare figure::properties::toolkit as mutable
John W. Eaton <jwe@octave.org>
parents:
27698
diff
changeset
|
3339 |
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 octave::graphics_toolkit m_toolkit; |
6874 | 3341 }; |
3342 | |
3343 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
|
3344 properties m_properties; |
6874 | 3345 |
3346 public: | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
3347 |
6874 | 3348 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
|
3349 : 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
|
3350 { } |
6874 | 3351 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
3352 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (figure) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
3353 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3354 ~figure () = default; |
6874 | 3355 |
3356 void override_defaults (base_graphics_object& obj) | |
3357 { | |
26878
3c7c5b7c3044
doc: Refer to "root object" rather than "root figure object".
Rik <rik@octave.org>
parents:
26520
diff
changeset
|
3358 // Allow parent (root object) to override first (properties knows how |
6874 | 3359 // 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
|
3360 m_properties.override_defaults (obj); |
6874 | 3361 |
3362 // Now override with our defaults. If the default_properties | |
3363 // list includes the properties for all defaults (line, | |
3364 // surface, etc.) then we don't have to know the type of OBJ | |
3365 // here, we just call its set function and let it decide which | |
3366 // 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
|
3367 obj.set_from_list (m_default_properties); |
6874 | 3368 } |
3369 | |
7189 | 3370 void set (const caseless_str& name, const octave_value& value) |
6874 | 3371 { |
3372 if (name.compare ("default", 7)) | |
3373 // strip "default", pass rest to function that will | |
3374 // parse the remainder and add the element to the | |
3375 // 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
|
3376 m_default_properties.set (name.substr (7), value); |
6874 | 3377 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
|
3378 m_properties.set (name, value); |
6874 | 3379 } |
3380 | |
7189 | 3381 octave_value get (const caseless_str& name) const |
6874 | 3382 { |
3383 octave_value retval; | |
3384 | |
3385 if (name.compare ("default", 7)) | |
3386 retval = get_default (name.substr (7)); | |
3387 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
|
3388 retval = m_properties.get (name); |
6874 | 3389 |
3390 return retval; | |
3391 } | |
3392 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3393 OCTINTERP_API octave_value get_default (const caseless_str& name) const; |
6874 | 3394 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3395 octave_value get_defaults () const |
6874 | 3396 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3397 return m_default_properties.as_struct ("default"); |
6874 | 3398 } |
3399 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3400 property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
3401 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3402 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
|
3403 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3404 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3405 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3406 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3407 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3408 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3409 bool valid_object () const { return true; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3410 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3411 OCTINTERP_API void reset_default_properties (); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
3412 |
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
|
3413 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
|
3414 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3415 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
|
3416 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
|
3417 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
|
3418 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
|
3419 } |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
3420 |
6874 | 3421 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
|
3422 property_list m_default_properties; |
6874 | 3423 }; |
3424 | |
3425 // --------------------------------------------------------------------- | |
3426 | |
7435 | 3427 class OCTINTERP_API graphics_xform |
3428 { | |
3429 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3430 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3431 graphics_xform () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3432 : 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
|
3433 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
|
3434 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3435 m_zlim(1) = 1.0; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3436 } |
7435 | 3437 |
3438 graphics_xform (const Matrix& xm, const Matrix& xim, | |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
3439 const scaler& x, const scaler& y, const scaler& z, |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
3440 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
|
3441 : 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
|
3442 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
|
3443 { } |
7435 | 3444 |
3445 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
|
3446 : 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
|
3447 m_sy (g.m_sy), m_sz (g.m_sz), m_zlim (g.m_zlim) { } |
7435 | 3448 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3449 ~graphics_xform () = default; |
7435 | 3450 |
3451 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
|
3452 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3453 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
|
3454 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
|
3455 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
|
3456 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
|
3457 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
|
3458 m_zlim = g.m_zlim; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3459 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3460 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3461 } |
7435 | 3462 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3463 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
|
3464 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3465 static OCTINTERP_API Matrix xform_eye (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3466 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3467 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
|
3468 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
|
3469 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3470 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
|
3471 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
|
3472 |
10553 | 3473 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
|
3474 { 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
|
3475 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3476 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
|
3477 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
|
3478 Matrix zscale (const Matrix& m) const { return m_sz.scale (m); } |
7435 | 3479 |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
3480 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
|
3481 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3482 bool has_z = (m.columns () > 2); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3483 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3484 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
|
3485 && (! 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
|
3486 return m; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3487 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3488 Matrix retval (m.dims ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3489 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3490 int r = m.rows (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3491 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3492 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
|
3493 { |
32589
05b4479c29d8
maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents:
32116
diff
changeset
|
3494 retval(i, 0) = m_sx.scale (m(i, 0)); |
05b4479c29d8
maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents:
32116
diff
changeset
|
3495 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
|
3496 if (has_z) |
32589
05b4479c29d8
maint: C++ style check for libinterp/ before 9.1 release.
Rik <rik@octave.org>
parents:
32116
diff
changeset
|
3497 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
|
3498 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3499 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3500 return retval; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3501 } |
7832
e06fdf7ea647
Fix default value of patch::facelighting. Add scaler/graphics_xform utilities
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7830
diff
changeset
|
3502 |
7435 | 3503 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
|
3504 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
|
3505 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
|
3506 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
|
3507 Matrix m_zlim; |
7435 | 3508 }; |
3509 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3510 enum |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3511 { |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3512 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
|
3513 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
|
3514 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
|
3515 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
|
3516 }; |
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3517 |
7365 | 3518 class OCTINTERP_API axes : public base_graphics_object |
6874 | 3519 { |
3520 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3521 |
7445 | 3522 class OCTINTERP_API properties : public base_properties |
6874 | 3523 { |
3524 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3525 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3526 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
|
3527 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
|
3528 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3529 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
|
3530 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
|
3531 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3532 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
|
3533 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3534 const scaler& get_x_scaler () const { return m_sx; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3535 const scaler& get_y_scaler () const { return m_sy; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3536 const scaler& get_z_scaler () const { return m_sz; } |
7427 | 3537 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3538 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
|
3539 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
|
3540 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
|
3541 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
|
3542 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
|
3543 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
|
3544 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3545 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
|
3546 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
|
3547 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3548 void update_boundingbox () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3549 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3550 if (units_is ("normalized")) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3551 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3552 sync_positions (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3553 base_properties::update_boundingbox (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3554 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3555 } |
7828
4739b6a1925c
Implement resize handler mechanism (call resizefcn on figure resize and notify children).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7827
diff
changeset
|
3556 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3557 OCTINTERP_API void update_camera (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3558 OCTINTERP_API void update_axes_layout (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3559 OCTINTERP_API void update_aspectratios (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3560 void update_transform () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3561 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3562 update_aspectratios (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3563 update_camera (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3564 update_axes_layout (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
3565 } |
7427 | 3566 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3567 OCTINTERP_API void sync_positions (); |
17098
786bcce466e9
Initialize the tightinset during initialization of axes.
Ben Abbott <bpabbott@mac.com>
parents:
17011
diff
changeset
|
3568 |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3569 // 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
|
3570 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3571 std::string get_activepositionproperty () const |
28303
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3572 { |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3573 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
|
3574 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3575 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
|
3576 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
|
3577 else |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3578 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
|
3579 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3580 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
|
3581 } |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3582 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3583 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
|
3584 { |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3585 // 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
|
3586 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
|
3587 |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3588 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
|
3589 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
|
3590 else |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3591 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
|
3592 } |
af912e78ce43
Mirror value of axes property "activepositionproperty" from "positionconstraint" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28302
diff
changeset
|
3593 |
28302
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3594 // 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
|
3595 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3596 octave_value get_innerposition () const |
28302
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3597 { |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3598 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
|
3599 } |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3600 |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3601 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
|
3602 { |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3603 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
|
3604 } |
1f5ec8c025bc
Mirror value of axes property "innerposition" from "position" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28298
diff
changeset
|
3605 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3606 OCTINTERP_API void update_autopos (const std::string& elem_type); |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3607 OCTINTERP_API void update_xlabel_position (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3608 OCTINTERP_API void update_ylabel_position (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3609 OCTINTERP_API void update_zlabel_position (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3610 OCTINTERP_API void update_title_position (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3611 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3612 graphics_xform get_transform () const |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3613 { |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3614 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
|
3615 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
|
3616 } |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3617 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3618 Matrix get_transform_matrix () const { return m_x_render; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3619 Matrix get_inverse_transform_matrix () const { return m_x_render_inv; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3620 Matrix get_opengl_matrix_1 () const { return m_x_gl_mat1; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3621 Matrix get_opengl_matrix_2 () const { return m_x_gl_mat2; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3622 Matrix get_transform_zlim () const { return m_x_zlim; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3623 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3624 int get_xstate () const { return m_xstate; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3625 int get_ystate () const { return m_ystate; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3626 int get_zstate () const { return m_zstate; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3627 double get_xPlane () const { return m_xPlane; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3628 double get_xPlaneN () const { return m_xPlaneN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3629 double get_yPlane () const { return m_yPlane; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3630 double get_yPlaneN () const { return m_yPlaneN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3631 double get_zPlane () const { return m_zPlane; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3632 double get_zPlaneN () const { return m_zPlaneN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3633 double get_xpTick () const { return m_xpTick; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3634 double get_xpTickN () const { return m_xpTickN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3635 double get_ypTick () const { return m_ypTick; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3636 double get_ypTickN () const { return m_ypTickN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3637 double get_zpTick () const { return m_zpTick; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3638 double get_zpTickN () const { return m_zpTickN; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3639 double get_x_min () const { return std::min (m_xPlane, m_xPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3640 double get_x_max () const { return std::max (m_xPlane, m_xPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3641 double get_y_min () const { return std::min (m_yPlane, m_yPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3642 double get_y_max () const { return std::max (m_yPlane, m_yPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3643 double get_z_min () const { return std::min (m_zPlane, m_zPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3644 double get_z_max () const { return std::max (m_zPlane, m_zPlaneN); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3645 double get_fx () const { return m_fx; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3646 double get_fy () const { return m_fy; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3647 double get_fz () const { return m_fz; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3648 double get_xticklen () const { return m_xticklen; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3649 double get_yticklen () const { return m_yticklen; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3650 double get_zticklen () const { return m_zticklen; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3651 double get_xtickoffset () const { return m_xtickoffset; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3652 double get_ytickoffset () const { return m_ytickoffset; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3653 double get_ztickoffset () const { return m_ztickoffset; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3654 bool get_x2Dtop () const { return m_x2Dtop; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3655 bool get_y2Dright () const { return m_y2Dright; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3656 bool get_layer2Dtop () const { return m_layer2Dtop; } |
23859
7148b237f94f
Fix regression introduced by cset 06805aabbdd1 (bug #50750).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23803
diff
changeset
|
3657 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
|
3658 { 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
|
3659 void set_has3Dkids (bool val) { m_has3Dkids = val; } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3660 bool get_xySym () const { return m_xySym; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3661 bool get_xyzSym () const { return m_xyzSym; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3662 bool get_zSign () const { return m_zSign; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3663 bool get_nearhoriz () 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
|
3664 |
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
|
3665 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
|
3666 { |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
3667 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
|
3668 (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
|
3669 } |
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
|
3670 |
1357bcae6e29
added pixel<->coord transform in axes and use it for display of cursor
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7836
diff
changeset
|
3671 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
|
3672 { 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
|
3673 |
29233
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 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3675 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
|
3676 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
|
3677 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
|
3678 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
|
3679 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
|
3680 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
|
3681 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
|
3682 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
|
3683 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3684 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
|
3685 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
|
3686 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
|
3687 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
|
3688 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3689 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
|
3690 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
|
3691 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
|
3692 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3693 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
|
3694 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
|
3695 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
|
3696 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3697 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
|
3698 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
|
3699 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
|
3700 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3701 OCTINTERP_API void unzoom (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3702 OCTINTERP_API void update_handlevisibility (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3703 OCTINTERP_API void push_zoom_stack (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3704 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
|
3705 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3706 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
|
3707 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3708 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
|
3709 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3710 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
|
3711 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3712 void increase_num_lights () { m_num_lights++; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3713 void decrease_num_lights () { m_num_lights--; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3714 unsigned int get_num_lights () 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
|
3715 |
7427 | 3716 private: |
23401
e0c20a22da7e
eliminate some errors exposed by -fsanitize=undefined
John W. Eaton <jwe@octave.org>
parents:
23396
diff
changeset
|
3717 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3718 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
|
3719 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
|
3720 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
|
3721 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3722 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
|
3723 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
|
3724 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
|
3725 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
|
3726 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
|
3727 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3728 std::list<octave_value> m_zoom_stack = std::list<octave_value> (); |
7427 | 3729 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3730 // 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
|
3731 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
|
3732 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
|
3733 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
|
3734 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3735 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
|
3736 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
|
3737 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
|
3738 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3739 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
|
3740 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
|
3741 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
|
3742 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3743 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
|
3744 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
|
3745 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
|
3746 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3747 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
|
3748 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
|
3749 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
|
3750 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3751 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
|
3752 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
|
3753 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
|
3754 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3755 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
|
3756 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
|
3757 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
|
3758 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3759 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
|
3760 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
|
3761 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
|
3762 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3763 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
|
3764 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
|
3765 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
|
3766 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
|
3767 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
|
3768 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
|
3769 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
|
3770 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
|
3771 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
|
3772 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3773 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
|
3774 |
21209
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
3775 // 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
|
3776 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
|
3777 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3778 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
|
3779 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
|
3780 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
|
3781 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3782 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
|
3783 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
|
3784 |
6874 | 3785 // See the genprops.awk script for an explanation of the |
3786 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3787 // 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
|
3788 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
3789 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
|
3790 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
|
3791 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
|
3792 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
|
3793 // 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
|
3794 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
|
3795 radio_property alphascale , "{linear}|log" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3796 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
|
3797 bool_property box u , "off" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3798 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
|
3799 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
|
3800 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
|
3801 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
|
3802 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
|
3803 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
|
3804 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
|
3805 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
|
3806 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
|
3807 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
|
3808 radio_property climmode al , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3809 radio_property clippingstyle , "{3dbox}|rectangle" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3810 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
|
3811 array_property colormap sg , Matrix () |
7363 | 3812 array_property colororder , default_colororder () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3813 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
|
3814 radio_property colorscale , "{linear}|log" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3815 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
|
3816 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
|
3817 radio_property dataaspectratiomode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3818 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
|
3819 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
|
3820 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
|
3821 // 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
|
3822 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
|
3823 bool_property fontsmoothing u , "on" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3824 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
|
3825 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
|
3826 double_property gridalpha m , 0.15 |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3827 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
|
3828 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
|
3829 radio_property gridcolormode , "{auto}|manual" |
22056
05ad23810150
Use default gridlinestyle of '-' for Matlab compatibility.
Rik <rik@octave.org>
parents:
22022
diff
changeset
|
3830 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
|
3831 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
|
3832 // 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
|
3833 // 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
|
3834 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
|
3835 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
|
3836 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
|
3837 // 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
|
3838 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
|
3839 // 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
|
3840 handle_property legend r , graphics_handle () |
17382
50b2863d10a6
Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents:
17104
diff
changeset
|
3841 // FIXME: should be kind of string array. |
50b2863d10a6
Create Matlab compatible linestyleorder char matrices (bug #34906)
Rik <rik@octave.org>
parents:
17104
diff
changeset
|
3842 any_property linestyleorder S , "-" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3843 double_property linestyleorderindex , 1.0 |
7403 | 3844 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
|
3845 double_property minorgridalpha m , 0.25 |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3846 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
|
3847 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
|
3848 radio_property minorgridcolormode , "{auto}|manual" |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3849 radio_property minorgridlinestyle , "{:}|-|--|-.|none" |
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3850 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
|
3851 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
|
3852 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
|
3853 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
|
3854 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
|
3855 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
|
3856 radio_property positionconstraint , "{outerposition}|innerposition" |
18819
92e9d4710f78
Fix typo in graphics.in.h (bug #42535).
Michael Godfrey <michaeldgodfrey@gmail.com>
parents:
17822
diff
changeset
|
3857 radio_property projection , "{orthographic}|perspective" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3858 radio_property sortmethod , "{depth}|childorder" |
32116
7e774d71c491
Add support for "none" option to axes graphic property "TickDir".
Rik <rik@octave.org>
parents:
31883
diff
changeset
|
3859 radio_property tickdir mu , "{in}|out|both|none" |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
3860 radio_property tickdirmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3861 // 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
|
3862 radio_property ticklabelinterpreter u , "{tex}|latex|none" |
14391
c9ec21bef97a
Fix ticklength updating (bug # 35438).
Ben Abbott <bpabbott@mac.com>
parents:
14357
diff
changeset
|
3863 array_property ticklength u , default_axes_ticklength () |
7403 | 3864 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
|
3865 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
|
3866 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
|
3867 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
|
3868 // 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
|
3869 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
|
3870 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
|
3871 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
|
3872 // 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
|
3873 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
|
3874 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
|
3875 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
|
3876 radio_property xcolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3877 radio_property xdir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3878 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
|
3879 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
|
3880 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
|
3881 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
|
3882 radio_property xlimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3883 bool_property xminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3884 bool_property xminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3885 radio_property xscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3886 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
|
3887 // 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
|
3888 any_property xticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3889 radio_property xticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3890 double_property xticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3891 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
|
3892 // 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
|
3893 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
|
3894 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
|
3895 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
|
3896 radio_property ycolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3897 radio_property ydir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3898 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
|
3899 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
|
3900 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
|
3901 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
|
3902 radio_property ylimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3903 bool_property yminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3904 bool_property yminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3905 radio_property yscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3906 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
|
3907 any_property yticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3908 radio_property yticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3909 double_property yticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3910 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
|
3911 // 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
|
3912 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
|
3913 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
|
3914 radio_property zcolormode , "{auto}|manual" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3915 radio_property zdir u , "{normal}|reverse" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3916 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
|
3917 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
|
3918 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
|
3919 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
|
3920 radio_property zlimmode al , "{auto}|manual" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3921 bool_property zminorgrid , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3922 bool_property zminortick , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3923 radio_property zscale alu , "{linear}|log" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3924 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
|
3925 any_property zticklabel S , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3926 radio_property zticklabelmode u , "{auto}|manual" |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3927 double_property zticklabelrotation , 0.0 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3928 radio_property ztickmode u , "{auto}|manual" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3929 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3930 // 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
|
3931 array_property __colormap__ hu , Matrix () |
20258
530803d4f65f
Update root, figure, and axes graphics object properties.
Rik <rik@octave.org>
parents:
20232
diff
changeset
|
3932 double_property mousewheelzoom , 0.5 |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
3933 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3934 // 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
|
3935 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
|
3936 // hidden properties for inset |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
3937 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
|
3938 // hidden properties for minor ticks |
22623
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3939 row_vector_property xminortickvalues h , Matrix () |
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3940 row_vector_property yminortickvalues h , Matrix () |
76f1164d2135
Rename [xyz]mtick properties to [xyz]minortickvalues (bug #49205).
Rik <rik@octave.org>
parents:
22622
diff
changeset
|
3941 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
|
3942 // 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
|
3943 double_property __fontsize_points__ hgr , 0 |
7189 | 3944 END_PROPERTIES |
6874 | 3945 |
7363 | 3946 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3947 OCTINTERP_API void init (); |
7427 | 3948 |
3949 private: | |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3950 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3951 std::string |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3952 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
|
3953 { |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3954 std::string retval = scale; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3955 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3956 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
|
3957 retval = "neglog"; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3958 |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3959 return retval; |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3960 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3961 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3962 void update_xscale () |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3963 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3964 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
|
3965 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3966 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3967 void update_yscale () |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3968 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3969 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
|
3970 } |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3971 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3972 void update_zscale () |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
3973 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3974 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
|
3975 } |
7427 | 3976 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
3977 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
|
3978 update_label_color (handle_property label, color_property col); |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3979 void update_xcolor () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3980 { 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
|
3981 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3982 void update_ycolor () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3983 { 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
|
3984 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3985 void update_zcolor () |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
3986 { 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
|
3987 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3988 void update_view () { sync_positions (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3989 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3990 void update_cameraposition () { update_transform (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3991 void update_cameratarget () { update_transform (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3992 void update_cameraupvector () { update_transform (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3993 void update_cameraviewangle () { update_transform (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3994 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
3995 void update_camerapositionmode () |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3996 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3997 if (camerapositionmode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3998 update_cameraposition (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
3999 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4000 void update_cameratargetmode () |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4001 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4002 if (cameratargetmode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4003 update_cameratarget (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4004 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4005 void update_cameraupvectormode () |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4006 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4007 if (cameraupvectormode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4008 update_cameraupvector (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4009 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4010 void update_cameraviewanglemode () |
24127
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4011 { |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4012 if (cameraviewanglemode_is ("auto")) |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4013 update_cameraviewangle (); |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4014 } |
b188be2b962b
Call update_transform on camera property change (bug #44503)
Colin Macdonald <cbm@m.fsf.org>
parents:
24120
diff
changeset
|
4015 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4016 void update_dataaspectratio () { sync_positions (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4017 void update_dataaspectratiomode () { sync_positions (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4018 void update_plotboxaspectratio () { sync_positions (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4019 void update_plotboxaspectratiomode () { sync_positions (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4020 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4021 void update_layer () { update_axes_layout (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4022 void update_box () |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4023 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4024 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
|
4025 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
|
4026 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
|
4027 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
|
4028 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4029 (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
|
4030 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
|
4031 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
|
4032 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
|
4033 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
|
4034 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
|
4035 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4036 (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
|
4037 m_ylim); |
23116
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4038 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4039 void update_yaxislocation () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4040 { |
19652
5b4fd7ebcfc6
Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19597
diff
changeset
|
4041 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4042 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
|
4043 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
|
4044 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
|
4045 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
|
4046 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
|
4047 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4048 (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
|
4049 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
|
4050 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
|
4051 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
|
4052 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
|
4053 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
|
4054 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4055 (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
|
4056 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4057 update_ylabel_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4058 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4059 void update_xaxislocation () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4060 { |
19652
5b4fd7ebcfc6
Update "tightinset" when "x/yaxislocation" is changed
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19597
diff
changeset
|
4061 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4062 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
|
4063 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
|
4064 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
|
4065 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
|
4066 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
|
4067 (yaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4068 (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
|
4069 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
|
4070 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
|
4071 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
|
4072 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
|
4073 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
|
4074 (xaxislocation_is ("origin") ? 0 : |
fdd67d871a72
Keep manually set tick labels (bug #52284).
Markus Mützel <markus.muetzel@gmx.de>
parents:
24127
diff
changeset
|
4075 (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
|
4076 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4077 update_xlabel_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4078 } |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4079 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4080 void update_xdir () { update_camera (); update_axes_layout (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4081 void update_ydir () { update_camera (); update_axes_layout (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4082 void update_zdir () { update_camera (); update_axes_layout (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4083 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4084 void update_ticklength (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4085 void update_tickdir () { update_ticklength (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4086 void update_tickdirmode () { update_ticklength (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4087 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4088 void update_ticklabelinterpreter () |
26055
8b9e6a39e0a2
Allow log axes to be exported correctly in tex formats (bug #50130).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26045
diff
changeset
|
4089 { |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4090 update_xtick (false); |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4091 update_ytick (false); |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4092 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
|
4093 } |
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
|
4094 |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4095 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
|
4096 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4097 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
|
4098 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
|
4099 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
|
4100 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
|
4101 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
|
4102 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
|
4103 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
|
4104 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
|
4105 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4106 (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
|
4107 m_xlim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4108 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4109 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4110 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4111 } |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4112 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
|
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 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
|
4115 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
|
4116 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
|
4117 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
|
4118 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
|
4119 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
|
4120 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
|
4121 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
|
4122 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4123 (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
|
4124 m_ylim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4125 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4126 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4127 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4128 } |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4129 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
|
4130 { |
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 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
|
4132 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
|
4133 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
|
4134 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
|
4135 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
|
4136 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
|
4137 2, m_zlim); |
29650
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4138 |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4139 if (sync_pos) |
360d21b028b1
Synchronize positions optionally when updating axes ticks (bug #60583)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29572
diff
changeset
|
4140 sync_positions (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4141 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4142 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4143 void update_xtickmode () |
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_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
|
4146 update_xtick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4147 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4148 void update_ytickmode () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4149 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4150 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
|
4151 update_ytick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4152 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4153 void update_ztickmode () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4154 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4155 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
|
4156 update_ztick (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4157 } |
11394
ecd87194adb6
Update ticks after {xyz}tickmode is set to auto
Konstantinos Poulios <logari81@googlemail.com>
parents:
11385
diff
changeset
|
4158 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4159 void update_xticklabelmode () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4160 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4161 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
|
4162 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
|
4163 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
|
4164 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
|
4165 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4166 (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
|
4167 m_xlim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4168 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4169 void update_yticklabelmode () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4170 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4171 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
|
4172 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
|
4173 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
|
4174 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
|
4175 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4176 (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
|
4177 m_ylim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4178 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4179 void update_zticklabelmode () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4180 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4181 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
|
4182 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
|
4183 false, 2, m_zlim); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4184 } |
9347
3da821b161e9
imported patch ticklabel
Michael Goffioul <michael.goffioul@gmail.com>
parents:
9188
diff
changeset
|
4185 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4186 void update_fontname () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4187 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4188 update_font ("fontname"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4189 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4190 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4191 void update_fontsize () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4192 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4193 update_font ("fontsize"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4194 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4195 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4196 void update_fontsmoothing () |
26858
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4197 { |
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4198 update_font ("fontsmoothing"); |
0adb232f93b9
Implement axes and text "fontsmoothing" property (bug #55833).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
26715
diff
changeset
|
4199 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4200 void update_fontangle () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4201 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4202 update_font ("fontangle"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4203 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4204 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4205 void update_fontweight () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4206 { |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4207 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
|
4208 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
|
4209 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4210 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4211 void update_titlefontsizemultiplier () |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4212 { |
26371
87f11da73b19
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4213 // 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
|
4214 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
|
4215 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
|
4216 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4217 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4218 void update_labelfontsizemultiplier () |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4219 { |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4220 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
|
4221 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
|
4222 } |
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4223 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4224 void update_titlefontweight () |
22723
03cebe1fb0e3
Update labels and title font according to axes font properties (bug #49469)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22710
diff
changeset
|
4225 { |
26371
87f11da73b19
graphics.h: Fix static analyzer detected issues (bug #55347).
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4226 // 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
|
4227 update_font ("fontweight"); |
19684
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4228 sync_positions (); |
2b93834e5ede
Update tightinset when "font*" properties are changed (bug #39581)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19678
diff
changeset
|
4229 } |
12777
6c1d0f03c331
Avoid redundant calls to set_font of text renderers (Bug #31305)
Konstantinos Poulios <logari81@gmail.com>
parents:
12685
diff
changeset
|
4230 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4231 OCTINTERP_API void update_outerposition (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4232 OCTINTERP_API void update_position (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4233 OCTINTERP_API void update_looseinset (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4234 |
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 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
|
4236 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
|
4237 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
|
4238 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
|
4239 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
|
4240 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
|
4241 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
|
4242 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
|
4243 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
|
4244 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
|
4245 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
|
4246 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
|
4247 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
|
4248 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
|
4249 const Matrix& limits); |
12334
63dc132a1000
Move axes labels and title positioning to axes::properties
Konstantinos Poulios <logari81@gmail.com>
parents:
12327
diff
changeset
|
4250 |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4251 void fix_limits (array_property& lims) |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4252 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
4253 if (lims.get ().isempty ()) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4254 return; |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4255 |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4256 Matrix l = lims.get ().matrix_value (); |
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4257 if (l(0) > l(1)) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4258 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4259 l(0) = 0; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4260 l(1) = 1; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4261 lims = l; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4262 } |
7854
228858e69bd1
added {x,y,z}lim sanity check
Shai Ayal <shaiay@users.sourceforge.net>
parents:
7850
diff
changeset
|
4263 else if (l(0) == l(1)) |
10317
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4264 { |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4265 l(0) -= 0.5; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4266 l(1) += 0.5; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4267 lims = l; |
42d098307c30
untabify additional source files
John W. Eaton <jwe@octave.org>
parents:
10289
diff
changeset
|
4268 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4269 } |
7446 | 4270 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4271 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
|
4272 |
23524
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4273 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
|
4274 { |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4275 set___colormap__ (val); |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4276 } |
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4277 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4278 void update___colormap__ () |
24501
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4279 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4280 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
|
4281 } |
2f10c3265607
Make sure axes "colormap" property listeners are executed (bug #52799).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24452
diff
changeset
|
4282 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4283 OCTINTERP_API octave_value get_colormap () const; |
23524
7c278572db66
Implement colormap property for axes objects (bug #48667).
Markus Muetzel <markus.muetzel@gmx.de>
parents:
23457
diff
changeset
|
4284 |
7446 | 4285 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4286 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
|
4287 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
|
4288 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
|
4289 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
|
4290 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4291 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
|
4292 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
|
4293 const bool logscale, char& update_type); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4294 |
19663
dfea01b3425f
more mouse interaction features for Qt plotting widget
John W. Eaton <jwe@octave.org>
parents:
19659
diff
changeset
|
4295 void update_xlim () |
7446 | 4296 { |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4297 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
|
4298 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4299 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
|
4300 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
|
4301 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
|
4302 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
|
4303 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
|
4304 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
|
4305 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
|
4306 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
|
4307 (yaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4308 (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
|
4309 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
|
4310 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4311 fix_limits (m_xlim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4312 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4313 update_xscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4314 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4315 update_axes_layout (); |
7446 | 4316 } |
4317 | |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4318 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
|
4319 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4320 update_xlim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4321 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4322 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4323 void update_ylim () |
7446 | 4324 { |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4325 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
|
4326 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4327 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
|
4328 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
|
4329 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
|
4330 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
|
4331 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
|
4332 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
|
4333 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
|
4334 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
|
4335 (xaxislocation_is ("origin") ? 0 : |
868daa374c49
Improve support of "(xy)axislocation" "origin" (bug #48562).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23084
diff
changeset
|
4336 (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
|
4337 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
|
4338 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4339 fix_limits (m_ylim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4340 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4341 update_yscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4342 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4343 update_axes_layout (); |
7446 | 4344 } |
4345 | |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4346 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
|
4347 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4348 update_ylim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4349 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4350 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4351 void update_zlim () |
7446 | 4352 { |
24030
ec3d37eeafa2
Auto-adjust limits that span 0 on logarithmic axes (bug #43606).
Markus Mützel <markus.muetzel@gmx.de>
parents:
23859
diff
changeset
|
4353 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
|
4354 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4355 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
|
4356 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
|
4357 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
|
4358 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
|
4359 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
|
4360 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
|
4361 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
|
4362 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4363 fix_limits (m_zlim); |
7855
f317f14516cb
Add zoom stack facility in axes object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7854
diff
changeset
|
4364 |
14324
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4365 update_zscale (); |
5a2b012b10c7
allow zooming for logscale plots
John W. Eaton <jwe@octave.org>
parents:
14314
diff
changeset
|
4366 |
12327
2ad37783bf01
Move axes layout from opengl_renderer::draw_axes to axes::properties
Konstantinos Poulios <logari81@googlemail.com>
parents:
12324
diff
changeset
|
4367 update_axes_layout (); |
7446 | 4368 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4369 |
30659
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4370 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
|
4371 { |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4372 update_zlim (); |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4373 } |
4c0c02102ba9
Allow for sticky "tight" option for auto axes limits (bug #61526)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
30565
diff
changeset
|
4374 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4375 void trigger_normals_calc (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
4376 |
6874 | 4377 }; |
4378 | |
4379 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
|
4380 properties m_properties; |
6874 | 4381 |
4382 public: | |
4383 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
|
4384 : 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
|
4385 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4386 m_properties.update_transform (); |
6874 | 4387 } |
4388 | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4389 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (axes) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4390 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4391 ~axes () = default; |
6874 | 4392 |
4393 void override_defaults (base_graphics_object& obj) | |
4394 { | |
4395 // Allow parent (figure) to override first (properties knows how | |
4396 // 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
|
4397 m_properties.override_defaults (obj); |
6874 | 4398 |
4399 // Now override with our defaults. If the default_properties | |
4400 // list includes the properties for all defaults (line, | |
4401 // surface, etc.) then we don't have to know the type of OBJ | |
4402 // here, we just call its set function and let it decide which | |
4403 // 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
|
4404 obj.set_from_list (m_default_properties); |
6874 | 4405 } |
4406 | |
7189 | 4407 void set (const caseless_str& name, const octave_value& value) |
6874 | 4408 { |
4409 if (name.compare ("default", 7)) | |
4410 // strip "default", pass rest to function that will | |
4411 // parse the remainder and add the element to the | |
4412 // 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
|
4413 m_default_properties.set (name.substr (7), value); |
6874 | 4414 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
|
4415 m_properties.set (name, value); |
6874 | 4416 } |
4417 | |
4418 void set_defaults (const std::string& mode) | |
4419 { | |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4420 m_properties.set_defaults (*this, mode); |
6874 | 4421 } |
4422 | |
7189 | 4423 octave_value get (const caseless_str& name) const |
6874 | 4424 { |
4425 octave_value retval; | |
4426 | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4427 // FIXME: finish this. |
6874 | 4428 if (name.compare ("default", 7)) |
4429 retval = get_default (name.substr (7)); | |
4430 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
|
4431 retval = m_properties.get (name); |
6874 | 4432 |
4433 return retval; | |
4434 } | |
4435 | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4436 OCTINTERP_API octave_value get_default (const caseless_str& name) const; |
6874 | 4437 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4438 octave_value get_defaults () const |
6874 | 4439 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4440 return m_default_properties.as_struct ("default"); |
6874 | 4441 } |
4442 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4443 property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
4444 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4445 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
|
4446 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4447 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4448 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4449 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4450 const base_properties& get_properties () const { return m_properties; } |
7222 | 4451 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4452 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
|
4453 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4454 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
|
4455 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
|
4456 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4457 bool valid_object () const { return true; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4458 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4459 OCTINTERP_API void reset_default_properties (); |
10722
755fcb5baad3
Add the reset built function
David Bateman <dbateman@free.fr>
parents:
10717
diff
changeset
|
4460 |
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
|
4461 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
|
4462 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4463 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
|
4464 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
|
4465 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
|
4466 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
|
4467 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4468 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
4469 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4470 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
|
4471 |
6874 | 4472 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
|
4473 property_list m_default_properties; |
6874 | 4474 }; |
4475 | |
4476 // --------------------------------------------------------------------- | |
4477 | |
7365 | 4478 class OCTINTERP_API line : public base_graphics_object |
6874 | 4479 { |
4480 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4481 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4482 class OCTINTERP_API properties : public base_properties |
6874 | 4483 { |
4484 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4485 |
6874 | 4486 // See the genprops.awk script for an explanation of the |
4487 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4488 // Programming note: Keep property list sorted if new ones are added. |
7366 | 4489 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4490 BEGIN_PROPERTIES (line) |
20738
f90295782d60
Accept color value of "none" for line objects (bug #44224).
Rik <rik@octave.org>
parents:
20730
diff
changeset
|
4491 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
|
4492 string_property displayname , "" |
22759
39f39eb4e476
Implement "linejoin" property (bug #48387)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
22755
diff
changeset
|
4493 radio_property linejoin , "{round}|miter|chamfer" |
7363 | 4494 radio_property linestyle , "{-}|--|:|-.|none" |
4495 double_property linewidth , 0.5 | |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
4496 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
|
4497 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
|
4498 color_property markerfacecolor , color_property (radio_values ("auto|{none}"), color_values (0, 0, 0)) |
7363 | 4499 double_property markersize , 6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4500 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
|
4501 string_property xdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4502 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
|
4503 string_property ydatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4504 row_vector_property zdata u , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4505 string_property zdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4506 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4507 // 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
|
4508 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
|
4509 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
|
4510 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
|
4511 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
|
4512 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
|
4513 bool_property zliminclude hl , "on" |
6874 | 4514 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
|
4515 |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
4516 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4517 void init () |
25103
078b795c5219
maint: style check C++ ahead of 4.4 release.
Rik <rik@octave.org>
parents:
25054
diff
changeset
|
4518 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4519 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
|
4520 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
|
4521 } |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
4522 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4523 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4524 OCTINTERP_API Matrix compute_xlim () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4525 OCTINTERP_API Matrix compute_ylim () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4526 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4527 void update_xdata () { set_xlim (compute_xlim ()); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4528 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4529 void update_ydata () { set_ylim (compute_ylim ()); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4530 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4531 void update_zdata () { set_zlim (m_zdata.get_limits ()); } |
6874 | 4532 }; |
4533 | |
4534 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
|
4535 properties m_properties; |
6874 | 4536 |
4537 public: | |
4538 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
|
4539 : 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
|
4540 { } |
6874 | 4541 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4542 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (line) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4543 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4544 ~line () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4545 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4546 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4547 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4548 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4549 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4550 bool valid_object () 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
|
4551 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4552 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
|
4553 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4554 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
|
4555 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
|
4556 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
|
4557 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
|
4558 } |
6874 | 4559 }; |
4560 | |
4561 // --------------------------------------------------------------------- | |
4562 | |
7365 | 4563 class OCTINTERP_API text : public base_graphics_object |
6874 | 4564 { |
4565 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4566 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4567 class OCTINTERP_API properties : public base_properties |
6874 | 4568 { |
4569 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4570 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4571 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
|
4572 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
|
4573 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4574 OCTINTERP_API void update_text_extent (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4575 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4576 OCTINTERP_API void update_font (); |
25884
4e108574385c
Improve OpenGL rendering on high resolution screens with Qt 5 (bug #49053)
John Swensen <jpswensen@gmail.com>
parents:
25867
diff
changeset
|
4577 |
14448
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4578 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
|
4579 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4580 octave_value new_val (val); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4581 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4582 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
|
4583 { |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4584 dim_vector dv (1, 3); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4585 |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4586 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
|
4587 } |
20545
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4588 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4589 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
|
4590 { |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4591 set_positionmode ("manual"); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4592 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
|
4593 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
|
4594 mark_modified (); |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4595 } |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4596 else |
c547458dc10e
eliminate error_state from most header files
John W. Eaton <jwe@octave.org>
parents:
20459
diff
changeset
|
4597 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
|
4598 } |
7a49519913e3
Add custom inline set_postion method for text objects which accepts
Ben Abbott <bpabbott@mac.com>
parents:
14391
diff
changeset
|
4599 |
6874 | 4600 // See the genprops.awk script for an explanation of the |
4601 // properties declarations. | |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
4602 // Programming note: Keep property list sorted if new ones are added. |
6874 | 4603 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4604 BEGIN_PROPERTIES (text) |
17646
993ea21b7e03
graphics.in.h: Text "edgecolor" property should default to "none".
Rik <rik@octave.org>
parents:
17645
diff
changeset
|
4605 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
|
4606 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
|
4607 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
|
4608 bool_property editing , "off" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4609 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
|
4610 radio_property fontangle u , "{normal}|italic" |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4611 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4612 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
|
4613 bool_property fontsmoothing u , "on" |
19047
1288a2f27769
Handle non "points" fontunits properties (bug # 40158)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19044
diff
changeset
|
4614 radio_property fontunits SU , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
4615 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
|
4616 radio_property horizontalalignment mu , "{left}|center|right" |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4617 radio_property interpreter u , "{tex}|none|latex" |
7377 | 4618 radio_property linestyle , "{-}|--|:|-.|none" |
4619 double_property linewidth , 0.5 | |
26185
ef0998af70f9
Change "Margin" default of text object to 3.
Rik <rik@octave.org>
parents:
26129
diff
changeset
|
4620 double_property margin , 3 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4621 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
|
4622 double_property rotation mu , 0 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4623 text_label_property string u , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4624 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
|
4625 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
|
4626 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4627 // 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
|
4628 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
|
4629 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
|
4630 row_vector_property zlim hlr , Matrix () |
11281
3f952c6973f7
graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents:
11250
diff
changeset
|
4631 bool_property xliminclude hl , "off" |
3f952c6973f7
graphics.h.in: Change intended for 11272.
Ben Abbott <bpabbott@mac.com>
parents:
11250
diff
changeset
|
4632 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
|
4633 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
|
4634 // hidden properties for auto-positioning |
12389
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4635 radio_property positionmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4636 radio_property rotationmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4637 radio_property horizontalalignmentmode hu , "{auto}|manual" |
5367bd36b9f8
implement autopositioning requests from text objects to axes
Konstantinos Poulios <logari81@googlemail.com>
parents:
12334
diff
changeset
|
4638 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
|
4639 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
|
4640 // 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
|
4641 double_property __fontsize_points__ hgr , 0 |
6874 | 4642 END_PROPERTIES |
4643 | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4644 OCTINTERP_API Matrix get_data_position () const; |
29433
8811d8274118
Allow arbitrary text rotation onscreen (bug #33118)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
29359
diff
changeset
|
4645 OCTINTERP_API Matrix get_extent_matrix (bool rotated = false) const; |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4646 const uint8NDArray& get_pixels () const { return m_pixels; } |
21209
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
4647 |
67d2965af0b5
revamp text rendering classes
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
4648 // 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
|
4649 octave::text_renderer m_txt_renderer; |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4650 |
7363 | 4651 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4652 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4653 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4654 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
|
4655 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
|
4656 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
|
4657 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
|
4658 m_cached_units = get_units (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4659 update_font (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4660 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4661 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4662 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4663 void update_position () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4664 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4665 Matrix pos = get_data_position (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4666 Matrix lim; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4667 |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4668 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
|
4669 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
|
4670 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
|
4671 set_xlim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4672 |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4673 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
|
4674 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
|
4675 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
|
4676 set_ylim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4677 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4678 if (pos.numel () == 3) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4679 { |
26712
f8e7c1750222
Fix auto axes limits with text on negative logarithmic axes.
Markus Mützel <markus.muetzel@gmx.de>
parents:
26682
diff
changeset
|
4680 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
|
4681 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
|
4682 : 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
|
4683 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
|
4684 : lim(3)); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4685 set_zlim (lim); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4686 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4687 } |
10402
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4688 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4689 OCTINTERP_API void request_autopos (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4690 void update_positionmode () { request_autopos (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4691 void update_rotationmode () { request_autopos (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4692 void update_horizontalalignmentmode () { request_autopos (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4693 void update_verticalalignmentmode () { request_autopos (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4694 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4695 void update_string () { request_autopos (); update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4696 void update_rotation () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4697 void update_fontname () { update_font (); update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4698 void update_fontsize () { update_font (); update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4699 void update_fontsmoothing () { update_font (); update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4700 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4701 void update_color () |
26682
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4702 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4703 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
|
4704 { |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4705 update_font (); |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4706 update_text_extent (); |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4707 } |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4708 } |
0780d3f4ecad
Implement "none" as a color for axes and text objects (bug #52842).
Rik <rik@octave.org>
parents:
26639
diff
changeset
|
4709 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4710 void update_fontangle () |
23396
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
4711 { |
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
4712 update_font (); |
23210
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
4713 update_text_extent (); |
3a298e07002c
Deprecate "light" and "demi" values for "fontweight" property (bug #50353).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
23201
diff
changeset
|
4714 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4715 void update_fontweight () { update_font (); update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4716 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4717 void update_interpreter () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4718 void update_horizontalalignment () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4719 void update_verticalalignment () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4720 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4721 OCTINTERP_API void update_units (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4722 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
|
4723 |
9f2bf537a651
Implement text extent property
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10317
diff
changeset
|
4724 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
|
4725 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
|
4726 uint8NDArray m_pixels; |
6874 | 4727 }; |
4728 | |
4729 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
|
4730 properties m_properties; |
6874 | 4731 |
4732 public: | |
4733 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
|
4734 : 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
|
4735 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4736 m_properties.set_clipping ("off"); |
6874 | 4737 } |
4738 | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4739 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (text) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4740 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4741 ~text () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4742 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4743 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4744 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4745 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4746 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4747 bool valid_object () 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
|
4748 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4749 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
|
4750 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4751 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
|
4752 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
|
4753 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
|
4754 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
|
4755 } |
6874 | 4756 }; |
4757 | |
4758 // --------------------------------------------------------------------- | |
4759 | |
7365 | 4760 class OCTINTERP_API image : public base_graphics_object |
6874 | 4761 { |
4762 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4763 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
4764 class OCTINTERP_API properties : public base_properties |
6874 | 4765 { |
4766 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4767 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4768 bool is_aliminclude () 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
|
4769 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4770 std::string get_aliminclude () 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
|
4771 { return m_aliminclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4772 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4773 bool is_climinclude () const |
33128
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
4774 { return (m_climinclude.is_on () |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
4775 && ! (m_cdatamapping.is ("direct") |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
4776 || m_cdata.get ().ndims () == 3)); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4777 std::string get_climinclude () 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
|
4778 { 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
|
4779 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4780 OCTINTERP_API octave_value get_color_data () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4781 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4782 void initialize_data () { update_cdata (); } |
19324
68db8396c378
Make "image ()" use the default image cdata
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19087
diff
changeset
|
4783 |
6874 | 4784 // See the genprops.awk script for an explanation of the |
4785 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4786 // Programming note: Keep property list sorted if new ones are added. |
6874 | 4787 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
4788 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
|
4789 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
|
4790 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
|
4791 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
|
4792 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
|
4793 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
|
4794 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
|
4795 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4796 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4797 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
|
4798 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
|
4799 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
|
4800 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4801 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
|
4802 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
|
4803 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
|
4804 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
|
4805 radio_property ydatamode ha , "{auto}|manual" |
6874 | 4806 END_PROPERTIES |
4807 | |
7363 | 4808 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4809 void init () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
4810 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4811 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
|
4812 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
|
4813 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
|
4814 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
|
4815 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
|
4816 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
|
4817 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
|
4818 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
|
4819 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
|
4820 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
|
4821 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
|
4822 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
|
4823 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
|
4824 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
|
4825 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
|
4826 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
|
4827 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
|
4828 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
|
4829 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
|
4830 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
|
4831 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
|
4832 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4833 |
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4834 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4835 void update_alphadata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4836 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4837 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
|
4838 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
|
4839 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
|
4840 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
|
4841 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4842 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4843 void update_cdata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4844 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4845 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
|
4846 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
|
4847 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
|
4848 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
|
4849 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4850 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
|
4851 update_xdata (); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4852 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4853 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
|
4854 update_ydata (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
4855 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
4856 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4857 void update_xdata () |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4858 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4859 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
|
4860 set_xdatamode ("auto"); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4861 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4862 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
|
4863 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4864 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
|
4865 set_xdatamode ("auto"); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4866 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4867 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4868 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
|
4869 float dp = pixel_xsize (); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4870 |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4871 limits(0) = limits(0) - dp; |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4872 limits(1) = limits(1) + dp; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4873 set_xlim (limits); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4874 } |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4875 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4876 void update_ydata () |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4877 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4878 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
|
4879 set_ydatamode ("auto"); |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4880 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4881 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
|
4882 { |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4883 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
|
4884 set_ydatamode ("auto"); |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4885 } |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
4886 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4887 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
|
4888 float dp = pixel_ysize (); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4889 |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4890 limits(0) = limits(0) - dp; |
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4891 limits(1) = limits(1) + dp; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
4892 set_ylim (limits); |
9687
86aa08bbc887
image clipping and axes fixes
Shai Ayal <shaiay@users.sourceforge.net>
parents:
9680
diff
changeset
|
4893 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
4894 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4895 Matrix get_auto_xdata () |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4896 { |
32598
2f3b54f81947
avoid dim_vector copies in more places where possible (bug #64962)
John W. Eaton <jwe@octave.org>
parents:
32589
diff
changeset
|
4897 const dim_vector& dv = get_cdata ().dims (); |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4898 Matrix data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4899 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
|
4900 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4901 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
|
4902 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
|
4903 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4904 return data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4905 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4906 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4907 Matrix 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
|
4908 { |
32598
2f3b54f81947
avoid dim_vector copies in more places where possible (bug #64962)
John W. Eaton <jwe@octave.org>
parents:
32589
diff
changeset
|
4909 const dim_vector& dv = get_cdata ().dims (); |
18899
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4910 Matrix data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4911 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
|
4912 { |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4913 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
|
4914 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
|
4915 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4916 return data; |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4917 } |
3d9e503aea2c
Update image "x/ydata" when "cdata" is changed (bug #42121)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18850
diff
changeset
|
4918 |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4919 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
|
4920 { |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4921 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
|
4922 float dp; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4923 |
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
|
4924 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
|
4925 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
|
4926 else |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4927 { |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4928 if (limits(1) == limits(2)) |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4929 dp = 0.5; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4930 else |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4931 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
|
4932 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4933 return dp; |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4934 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4935 |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4936 public: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4937 float pixel_xsize () |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4938 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4939 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
|
4940 } |
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4941 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4942 float pixel_ysize () |
11076
b748b86cb8c1
fix images with width or height of 1
Shai Ayal <shaiay@users.sourceforge.net>
parents:
11075
diff
changeset
|
4943 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4944 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
|
4945 } |
6874 | 4946 }; |
4947 | |
4948 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
|
4949 properties m_properties; |
6874 | 4950 |
4951 public: | |
4952 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
|
4953 : 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
|
4954 { |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4955 m_properties.initialize_data (); |
6874 | 4956 } |
4957 | |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4958 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (image) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
4959 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4960 ~image () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4961 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4962 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4963 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4964 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4965 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4966 bool valid_object () 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
|
4967 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
4968 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
|
4969 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4970 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
|
4971 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
|
4972 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
|
4973 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
|
4974 } |
6874 | 4975 }; |
4976 | |
4977 // --------------------------------------------------------------------- | |
4978 | |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4979 class OCTINTERP_API light : public base_graphics_object |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4980 { |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4981 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
4982 |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4983 class OCTINTERP_API properties : public base_properties |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4984 { |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4985 // 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
|
4986 // properties declarations. |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4987 // 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
|
4988 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4989 BEGIN_PROPERTIES (light) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4990 color_property color , color_values (1, 1, 1) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4991 array_property position , default_light_position () |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4992 radio_property style , "{infinite}|local" |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4993 END_PROPERTIES |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4994 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4995 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
4996 void init () |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
4997 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
4998 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
|
4999 } |
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
|
5000 |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5001 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5002 OCTINTERP_API void update_visible (); |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5003 }; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5004 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5005 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
|
5006 properties m_properties; |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5007 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5008 public: |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5009 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
|
5010 : base_graphics_object (), m_properties (mh, p) |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5011 { } |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5012 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5013 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (light) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5014 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5015 ~light () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5016 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5017 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5018 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5019 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5020 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5021 bool valid_object () const { return true; } |
21789
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5022 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5023 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
|
5024 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5025 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
|
5026 if (! retval) |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5027 retval = base_properties::has_readonly_property (pname); |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5028 return retval; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5029 } |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5030 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5031 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5032 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
|
5033 }; |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5034 |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5035 // --------------------------------------------------------------------- |
6afdf40be534
Implement graphics object "light" (patch #8943).
mmuetzel <markus.muetzel@gmx.de>
parents:
21782
diff
changeset
|
5036 |
7365 | 5037 class OCTINTERP_API patch : public base_graphics_object |
6874 | 5038 { |
5039 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5040 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
5041 class OCTINTERP_API properties : public base_properties |
6874 | 5042 { |
5043 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5044 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5045 octave_value get_color_data () const; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5046 |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5047 // 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
|
5048 // 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
|
5049 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
|
5050 { |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5051 msg = m_bad_data_msg; |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
5052 return ! msg.empty (); |
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
5053 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5054 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5055 bool is_aliminclude () 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
|
5056 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5057 std::string get_aliminclude () 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
|
5058 { 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
|
5059 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5060 bool is_climinclude () const |
33128
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5061 { return (m_climinclude.is_on () |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5062 && ! (m_cdatamapping.is ("direct") |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5063 || m_cdata.get ().ndims () == 3)); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5064 std::string get_climinclude () 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
|
5065 { return m_climinclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5066 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5067 OCTINTERP_API bool get_do_lighting () 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
|
5068 |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5069 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
|
5070 |
6874 | 5071 // See the genprops.awk script for an explanation of the |
5072 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5073 // Programming note: Keep property list sorted if new ones are added. |
6874 | 5074 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5075 BEGIN_PROPERTIES (patch) |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5076 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
|
5077 double_property ambientstrength , 0.3 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5078 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
|
5079 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
|
5080 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
|
5081 double_property diffusestrength , 0.6 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5082 string_property displayname , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5083 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
|
5084 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
|
5085 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
|
5086 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
|
5087 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
|
5088 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
|
5089 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
|
5090 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
|
5091 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
|
5092 array_property facevertexalphadata , Matrix () |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5093 array_property facevertexcdata u , Matrix () |
7363 | 5094 radio_property linestyle , "{-}|--|:|-.|none" |
5095 double_property linewidth , 0.5 | |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5096 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
|
5097 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
|
5098 color_property markerfacecolor , color_property (radio_values ("{none}|auto|flat"), color_values (0, 0, 0)) |
7363 | 5099 double_property markersize , 6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5100 double_property specularcolorreflectance , 1.0 |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5101 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
|
5102 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
|
5103 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
|
5104 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
|
5105 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
|
5106 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
|
5107 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
|
5108 array_property zdata u , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5109 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5110 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5111 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5112 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
|
5113 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
|
5114 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
|
5115 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
|
5116 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5117 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
|
5118 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
|
5119 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
|
5120 bool_property zliminclude hl , "on" |
6874 | 5121 END_PROPERTIES |
5122 | |
7363 | 5123 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5124 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5125 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5126 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
|
5127 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
|
5128 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
|
5129 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
|
5130 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
|
5131 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
|
5132 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
|
5133 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
|
5134 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
|
5135 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
|
5136 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
|
5137 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
|
5138 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
|
5139 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
|
5140 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
|
5141 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
|
5142 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
|
5143 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
|
5144 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
|
5145 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
|
5146 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
|
5147 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
|
5148 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
|
5149 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
|
5150 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
|
5151 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
|
5152 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
|
5153 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
|
5154 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
|
5155 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5156 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
|
5157 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
|
5158 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
|
5159 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
|
5160 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
|
5161 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
|
5162 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
|
5163 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
|
5164 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
|
5165 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
|
5166 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
|
5167 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5168 |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5169 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
|
5170 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
|
5171 { |
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
|
5172 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
|
5173 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
|
5174 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5175 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5176 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5177 private: |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5178 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
|
5179 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5180 void update_faces () { update_data ();} |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5181 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5182 void update_vertices () { update_data ();} |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5183 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5184 void update_facevertexcdata () { update_data ();} |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5185 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5186 OCTINTERP_API void update_fvc (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5187 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5188 void update_xdata () |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5189 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
5190 if (get_xdata ().isempty ()) |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5191 { |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5192 // For compatibility with matlab behavior, |
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5193 // 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
|
5194 // 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
|
5195 set_ydata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5196 set_zdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5197 set_cdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5198 set_faces (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5199 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5200 else |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5201 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5202 update_fvc (); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5203 update_normals (true); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5204 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5205 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5206 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
|
5207 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5208 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5209 void update_ydata () |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5210 { |
23577
80c42f4cca13
maint: Deprecate is_empty and replace with isempty.
Rik <rik@octave.org>
parents:
23576
diff
changeset
|
5211 if (get_ydata ().isempty ()) |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5212 { |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5213 set_xdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5214 set_zdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5215 set_cdata (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5216 set_faces (Matrix ()); |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5217 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5218 else |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5219 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5220 update_fvc (); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5221 update_normals (true); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5222 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5223 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5224 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
|
5225 } |
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5226 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5227 void update_zdata () |
19597
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19596
diff
changeset
|
5228 { |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5229 update_fvc (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5230 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
|
5231 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
|
5232 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5233 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5234 void update_cdata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5235 { |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5236 update_fvc (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5237 update_normals (false); |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5238 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5239 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
|
5240 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
|
5241 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
|
5242 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
|
5243 } |
18901
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18899
diff
changeset
|
5244 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5245 OCTINTERP_API void update_data (); |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5246 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5247 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
|
5248 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
|
5249 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
|
5250 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5251 void update_edgelighting () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5252 { |
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
|
5253 update_normals (false); |
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5256 void update_facelighting () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5257 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5258 update_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5259 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5260 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5261 void update_facenormalsmode () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5262 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5263 update_face_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5264 } |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5265 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5266 void update_vertexnormalsmode () |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5267 { |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5268 update_vertex_normals (false); |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5269 } |
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
|
5270 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5271 void update_visible () |
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
|
5272 { |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5273 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
|
5274 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
|
5275 } |
6874 | 5276 }; |
5277 | |
5278 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
|
5279 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
|
5280 property_list m_default_properties; |
6874 | 5281 |
5282 public: | |
5283 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
|
5284 : 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
|
5285 { } |
6874 | 5286 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5287 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (patch) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5288 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5289 ~patch () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5290 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5291 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5292 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5293 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5294 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5295 bool valid_object () 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
|
5296 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5297 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
|
5298 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5299 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
|
5300 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
|
5301 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
|
5302 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
|
5303 } |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5304 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5305 OCTINTERP_API void reset_default_properties (); |
25425
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5306 |
107920dd7715
Automatically calculate normals for patch objects (patch #8951).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25423
diff
changeset
|
5307 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5308 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
|
5309 |
6874 | 5310 }; |
5311 | |
5312 // --------------------------------------------------------------------- | |
5313 | |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5314 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
|
5315 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5316 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5317 |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5318 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
|
5319 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5320 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5321 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5322 OCTINTERP_API octave_value get_color_data () const; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5323 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5324 // 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
|
5325 // 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
|
5326 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
|
5327 { |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5328 msg = m_bad_data_msg; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5329 return ! msg.empty (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5330 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5331 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5332 bool is_aliminclude () 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
|
5333 { return m_aliminclude.is_on (); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5334 std::string get_aliminclude () 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
|
5335 { return m_aliminclude.current_value (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5336 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5337 bool is_climinclude () 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
|
5338 { return m_climinclude.is_on (); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5339 std::string get_climinclude () 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
|
5340 { return m_climinclude.current_value (); } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5341 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5342 // 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
|
5343 // properties declarations. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5344 // 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
|
5345 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5346 BEGIN_PROPERTIES (scatter) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5347 array_property annotation , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5348 array_property cdata mu , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5349 radio_property cdatamode u , "{auto}|manual" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5350 string_property cdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5351 array_property datatiptemplate , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5352 string_property displayname , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5353 array_property latitudedata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5354 string_property latitudedatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5355 double_property linewidth , 0.5 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5356 array_property longitudedata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5357 string_property longitudedatasource , "" |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5358 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
|
5359 double_property markeredgealpha , 1.0 |
28414
04349a21c750
Implement "none" for scatter "markeredgecolor" property (bug #58508)
Rik <rik@octave.org>
parents:
28348
diff
changeset
|
5360 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
|
5361 double_property markerfacealpha , 1.0 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5362 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
|
5363 array_property rdata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5364 string_property rdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5365 array_property seriesindex u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5366 array_property sizedata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5367 string_property sizedatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5368 array_property thetadata , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5369 string_property thetadatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5370 array_property xdata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5371 string_property xdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5372 array_property ydata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5373 string_property ydatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5374 array_property zdata u , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5375 string_property zdatasource , "" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5376 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5377 // hidden properties for limit computation |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5378 row_vector_property alim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5379 row_vector_property clim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5380 row_vector_property xlim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5381 row_vector_property ylim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5382 row_vector_property zlim hlr , Matrix () |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5383 bool_property aliminclude hlg , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5384 bool_property climinclude hlg , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5385 bool_property xliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5386 bool_property yliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5387 bool_property zliminclude hl , "on" |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5388 END_PROPERTIES |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5389 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5390 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5391 void init () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5392 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5393 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
|
5394 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
|
5395 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
|
5396 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
|
5397 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
|
5398 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
|
5399 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
|
5400 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
|
5401 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
|
5402 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
|
5403 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
|
5404 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
|
5405 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
|
5406 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
|
5407 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
|
5408 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
|
5409 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
|
5410 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
|
5411 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
|
5412 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
|
5413 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
|
5414 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
|
5415 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
|
5416 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
|
5417 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
|
5418 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
|
5419 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
|
5420 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
|
5421 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
|
5422 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
|
5423 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
|
5424 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
|
5425 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
|
5426 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5427 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
|
5428 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
|
5429 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
|
5430 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
|
5431 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5432 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5433 public: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5434 OCTINTERP_API void update_color (); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5435 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5436 private: |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5437 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
|
5438 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5439 void update_xdata () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5440 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5441 if (get_xdata ().isempty ()) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5442 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5443 // For compatibility with Matlab behavior, |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5444 // 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
|
5445 set_ydata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5446 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
|
5447 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
|
5448 set_cdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5449 if (cdatamode_auto) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5450 set_cdatamode ("auto"); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5451 } |
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 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
|
5454 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5455 update_data (); |
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5458 void update_ydata () |
28286
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 if (get_ydata ().isempty ()) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5461 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5462 set_xdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5463 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
|
5464 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
|
5465 set_cdata (Matrix ()); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5466 if (cdatamode_auto) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5467 set_cdatamode ("auto"); |
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 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5470 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
|
5471 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5472 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5473 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5474 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5475 void update_zdata () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5476 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5477 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
|
5478 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5479 update_data (); |
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 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5482 void update_sizedata () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5483 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5484 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5485 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5486 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5487 void update_cdata () |
28286
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 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
|
5490 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
|
5491 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
|
5492 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
|
5493 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5494 update_data (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5495 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5496 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5497 void update_cdatamode () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5498 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5499 if (m_cdatamode.is ("auto")) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5500 update_color (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5501 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5502 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5503 void update_seriesindex () |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5504 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5505 if (m_cdatamode.is ("auto")) |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5506 update_color (); |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5507 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5508 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5509 void update_data (); |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5510 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5511 }; |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5512 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5513 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
|
5514 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
|
5515 property_list m_default_properties; |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5516 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5517 public: |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5518 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
|
5519 : 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
|
5520 { |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5521 // 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
|
5522 // object is added to the axes. |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5523 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5524 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5525 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (scatter) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5526 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5527 ~scatter () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5528 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5529 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5530 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5531 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5532 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5533 bool valid_object () const { return true; } |
28286
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5534 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5535 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
|
5536 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5537 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
|
5538 if (! retval) |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5539 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
|
5540 return retval; |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5541 } |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5542 |
496735a910c1
Add graphics object "scatter" (bug #58282).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28282
diff
changeset
|
5543 protected: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5544 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
|
5545 |
6874 | 5546 }; |
5547 | |
5548 // --------------------------------------------------------------------- | |
5549 | |
7365 | 5550 class OCTINTERP_API surface : public base_graphics_object |
6874 | 5551 { |
5552 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5553 |
7821
f79dcba526a8
Export nested properties classes of all graphics object.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7527
diff
changeset
|
5554 class OCTINTERP_API properties : public base_properties |
6874 | 5555 { |
5556 public: | |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5557 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5558 octave_value get_color_data () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5559 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5560 bool is_aliminclude () 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
|
5561 { return (m_aliminclude.is_on () && m_alphadatamapping.is ("scaled")); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5562 std::string get_aliminclude () 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
|
5563 { 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
|
5564 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5565 bool is_climinclude () const |
33128
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5566 { return (m_climinclude.is_on () |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5567 && ! (m_cdatamapping.is ("direct") |
7a25ad58d79e
Don't update 'clim' property for TrueColor data (bug #65404)
Rik <rik@octave.org>
parents:
32734
diff
changeset
|
5568 || m_cdata.get ().ndims () == 3)); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5569 std::string get_climinclude () 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
|
5570 { return m_climinclude.current_value (); } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5571 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5572 OCTINTERP_API bool get_do_lighting () 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
|
5573 |
6874 | 5574 // See the genprops.awk script for an explanation of the |
5575 // properties declarations. | |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5576 // Programming note: Keep property list sorted if new ones are added. |
6874 | 5577 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5578 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
|
5579 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
|
5580 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
|
5581 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
|
5582 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
|
5583 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
|
5584 radio_property cdatamapping al , "{scaled}|direct" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5585 string_property cdatasource , "" |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5586 double_property diffusestrength , 0.6 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5587 string_property displayname , "" |
7846
d7737a4268b7
Fix typos in property names (edgealpha/facealpha).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7844
diff
changeset
|
5588 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
|
5589 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
|
5590 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
|
5591 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
|
5592 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
|
5593 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
|
5594 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
|
5595 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
|
5596 radio_property linestyle , "{-}|--|:|-.|none" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5597 double_property linewidth , 0.5 |
30253
20fd3c03fd74
Add new plot marker styles '|' and '_' (bug #61350)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
5598 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
|
5599 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
|
5600 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
|
5601 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
|
5602 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
|
5603 double_property specularcolorreflectance , 1 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5604 double_property specularexponent , 10 |
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5605 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
|
5606 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
|
5607 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
|
5608 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
|
5609 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
|
5610 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
|
5611 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
|
5612 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
|
5613 string_property zdatasource , "" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5614 |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5615 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5616 row_vector_property alim hlr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5617 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
|
5618 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
|
5619 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
|
5620 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
|
5621 bool_property aliminclude hlg , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5622 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
|
5623 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
|
5624 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
|
5625 bool_property zliminclude hl , "on" |
6874 | 5626 END_PROPERTIES |
5627 | |
7363 | 5628 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5629 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5630 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5631 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
|
5632 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
|
5633 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
|
5634 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
|
5635 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
|
5636 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
|
5637 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
|
5638 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
|
5639 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
|
5640 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
|
5641 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
|
5642 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
|
5643 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
|
5644 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
|
5645 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
|
5646 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
|
5647 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
|
5648 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
|
5649 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
|
5650 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
|
5651 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
|
5652 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
|
5653 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
|
5654 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
|
5655 |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5656 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
|
5657 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
|
5658 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
|
5659 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
|
5660 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
|
5661 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
|
5662 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
|
5663 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
|
5664 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
|
5665 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
|
5666 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
|
5667 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5668 |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5669 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
|
5670 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
|
5671 { |
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
|
5672 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
|
5673 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
|
5674 } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5675 |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5676 |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5677 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5678 void update_alphadata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5679 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5680 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
|
5681 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
|
5682 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
|
5683 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
|
5684 } |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5685 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5686 void update_cdata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5687 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5688 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
|
5689 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
|
5690 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
|
5691 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
|
5692 } |
7829
8ca8e97e8c0a
Add rendering interface for surface object (no implementation yet).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7828
diff
changeset
|
5693 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5694 void update_xdata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5695 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5696 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
|
5697 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
|
5698 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5699 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5700 void update_ydata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5701 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5702 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
|
5703 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
|
5704 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5705 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5706 void update_zdata () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5707 { |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5708 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
|
5709 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
|
5710 } |
7862
8f3459a90bf3
Redesign axis limit computation handling (using hidden limit properties in child objects)
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7860
diff
changeset
|
5711 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5712 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
|
5713 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
|
5714 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5715 void update_facenormalsmode () |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5716 { 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
|
5717 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5718 void update_vertexnormalsmode () |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5719 { 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
|
5720 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5721 void update_edgelighting () |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5722 { update_normals (false); } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5723 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5724 void update_facelighting () |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5725 { update_normals (false); } |
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5726 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5727 void update_visible () |
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
|
5728 { |
10145b9ad883
Update normals when turning visibility of surface and patch on (bug #54970).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26037
diff
changeset
|
5729 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
|
5730 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
|
5731 } |
25867
49ffa78f9243
Use "facenormals" for flat lighting on surfaces (bug #54024).
Markus Mützel <markus.muetzel@gmx.de>
parents:
25449
diff
changeset
|
5732 |
6874 | 5733 }; |
5734 | |
5735 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
|
5736 properties m_properties; |
6874 | 5737 |
5738 public: | |
5739 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
|
5740 : 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
|
5741 { } |
6874 | 5742 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5743 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (surface) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5744 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5745 ~surface () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5746 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5747 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5748 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5749 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5750 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5751 bool valid_object () 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
|
5752 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5753 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
|
5754 { |
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 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
|
5756 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
|
5757 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
|
5758 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
|
5759 } |
6874 | 5760 }; |
5761 | |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5762 // --------------------------------------------------------------------- |
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 class OCTINTERP_API hggroup : public base_graphics_object |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5765 { |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5766 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5767 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5768 class OCTINTERP_API properties : public base_properties |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5769 { |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5770 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5771 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5772 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
|
5773 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
|
5774 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5775 OCTINTERP_API void adopt (const graphics_handle& h); |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5776 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5777 // 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
|
5778 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5779 // 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
|
5780 |
8247
e41f420875db
set name of root_figure object to root
John W. Eaton <jwe@octave.org>
parents:
8222
diff
changeset
|
5781 BEGIN_PROPERTIES (hggroup) |
15519
f915996325b7
Add missing DisplayName and EraseMode properties to hggroups (bug #37442)
Ben Abbott <bpabbott@mac.com>
parents:
15468
diff
changeset
|
5782 string_property displayname , "" |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5783 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5784 // hidden properties for limit computation |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5785 row_vector_property alim hr , Matrix () |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5786 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
|
5787 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
|
5788 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
|
5789 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
|
5790 bool_property aliminclude h , "on" |
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5791 bool_property climinclude h , "on" |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5792 bool_property xliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5793 bool_property yliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5794 bool_property zliminclude h , "on" |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5795 END_PROPERTIES |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5796 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5797 private: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5798 OCTINTERP_API void update_limits () const; |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5799 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5800 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
|
5801 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5802 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5803 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5804 { } |
11175
c0a95a5c6d25
Address the speed of plotting large hggroup groups and in particular
David Bateman <dbateman@free.fr>
parents:
11167
diff
changeset
|
5805 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5806 }; |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5807 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5808 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
|
5809 properties m_properties; |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5810 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5811 public: |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5812 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
|
5813 : 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
|
5814 { } |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5815 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5816 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (hggroup) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5817 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5818 ~hggroup () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5819 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5820 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5821 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5822 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5823 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5824 bool valid_object () 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
|
5825 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5826 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
|
5827 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5828 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
|
5829 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
|
5830 |
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
|
5831 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
|
5832 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5833 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
|
5834 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
|
5835 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
|
5836 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
|
5837 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5838 |
7865
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5839 }; |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5840 |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5841 // --------------------------------------------------------------------- |
b74039822fd2
Add support for hggroup
Michael Goffioul <michael.goffioul@gmail.com>
parents:
7864
diff
changeset
|
5842 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5843 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
|
5844 { |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5845 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5846 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5847 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
|
5848 { |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5849 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5850 |
26930
ead8f91c5556
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26918
diff
changeset
|
5851 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
|
5852 { |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5853 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
|
5854 } |
8d7265e353a0
Improve performance when closing figures (bug #55908).
Markus Mützel <markus.muetzel@gmx.de>
parents:
26878
diff
changeset
|
5855 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5856 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
|
5857 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5858 base_properties::adopt (h); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5859 } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5860 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5861 // 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
|
5862 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5863 // 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
|
5864 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5865 BEGIN_PROPERTIES (uimenu) |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5866 string_property accelerator , "" |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5867 // Deprecated in R2017b (replaced by "MenuSelectedFcn") |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5868 callback_property callback hgs , Matrix () |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5869 bool_property checked , "off" |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5870 bool_property enable , "on" |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5871 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
|
5872 // Deprecated in R2017b (replaced by "Text") |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5873 string_property label hgs , "" |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5874 callback_property menuselectedfcn , Matrix () |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5875 // 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
|
5876 // 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
|
5877 double_property position , 0 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5878 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
|
5879 string_property text , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5880 |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5881 // 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
|
5882 string_property __fltk_label__ h , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5883 any_property __object__ h , Matrix () |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5884 END_PROPERTIES |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5885 |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5886 // Make "Label" an alias for "Text". |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5887 std::string get_label () const |
29913
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5888 { |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5889 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
|
5890 } |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5891 |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5892 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
|
5893 { |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5894 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
|
5895 } |
3eca54836f97
Allow 'Label' to be used as a synonym for 'Text' on uimenus (bug #60870)
Rik <rik@octave.org>
parents:
29889
diff
changeset
|
5896 |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5897 // Make "Callback" an alias for "MenuSelectedFcn". |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5898 octave_value get_callback () const |
30999
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5899 { |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5900 return get_menuselectedfcn (); |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5901 } |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5902 |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5903 void set_callback (const octave_value& val) |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5904 { |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5905 set_menuselectedfcn (val); |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5906 } |
fef2957c38ec
Deprecate uimenu properties "label" and "callback" (bug #62443)
Rik <rik@octave.org>
parents:
30994
diff
changeset
|
5907 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5908 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5909 void init () |
22831
96228c17a66a
Add input checking for double_property and handle_property (task #11311)
Markus Mützel <markus.muetzel@gmx.de>
parents:
22759
diff
changeset
|
5910 { |
30993
63710f3bd981
Stop incorrect error when reset() called on uimenu handle (bug #62425)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
5911 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
|
5912 } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5913 }; |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5914 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5915 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
|
5916 properties m_properties; |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5917 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5918 public: |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5919 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
|
5920 : 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
|
5921 { } |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5922 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5923 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uimenu) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5924 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5925 ~uimenu () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5926 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5927 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5928 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5929 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5930 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5931 bool valid_object () const { return true; } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11577
diff
changeset
|
5932 |
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
|
5933 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
|
5934 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5935 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
|
5936 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
|
5937 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
|
5938 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
|
5939 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
5940 |
11155
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5941 }; |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5942 |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5943 // --------------------------------------------------------------------- |
f0e9befd6a1c
add uimenu graphic object to fltk backend
Kai Habel <kai.habel@gmx.de>
parents:
11089
diff
changeset
|
5944 |
28298
e55ff14249c3
Mirror new base property "contextmenu" in "uicontextmenu" (bug #58336).
Markus Mützel <markus.muetzel@gmx.de>
parents:
28286
diff
changeset
|
5945 // 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
|
5946 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
|
5947 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5948 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
5949 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5950 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
|
5951 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5952 public: |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5953 |
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5954 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
|
5955 { 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
|
5956 |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5957 // FIXME: the list may contain duplicates. |
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
20171
diff
changeset
|
5958 // Should we return only unique elements? |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5959 const std::list<graphics_handle> get_dependent_obj_list () |
30040
805357e6b058
maint: use "m_" prefix for member variables of graphics objects.
Rik <rik@octave.org>
parents:
29993
diff
changeset
|
5960 { return m_dependent_obj_list; } |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5961 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5962 // 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
|
5963 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
5964 // 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
|
5965 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5966 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
|
5967 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
|
5968 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
|
5969 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5970 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
5971 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
|
5972 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5973 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5974 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5975 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
5976 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
5977 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
|
5978 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
|
5979 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
|
5980 } |
20077
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5981 |
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5982 private: |
69f92e0affd2
Handle uicontextmenu deletion/reset (bug #44801)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20051
diff
changeset
|
5983 // 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
|
5984 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
|
5985 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
5986 OCTINTERP_API void update_beingdeleted (); |
29014
df307ee1fb30
Don't rely on graphics_objects destructor being executed synchronously (bug #53513).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
28346
diff
changeset
|
5987 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5988 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5989 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5990 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
|
5991 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5992 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5993 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5994 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
|
5995 : 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
|
5996 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
5997 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5998 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uicontextmenu) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
5999 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6000 ~uicontextmenu () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6001 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6002 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6003 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6004 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6005 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6006 bool valid_object () const { return true; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6007 |
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
|
6008 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
|
6009 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6010 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
|
6011 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
|
6012 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
|
6013 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
|
6014 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6015 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6016 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6017 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6018 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6019 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6020 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
|
6021 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6022 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6023 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6024 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
|
6025 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6026 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6027 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6028 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
|
6029 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
|
6030 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
|
6031 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6032 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
|
6033 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
|
6034 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6035 // 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
|
6036 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6037 // 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
|
6038 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6039 BEGIN_PROPERTIES (uicontrol) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
6040 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
|
6041 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
|
6042 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
|
6043 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
|
6044 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
|
6045 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
|
6046 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
|
6047 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
|
6048 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
|
6049 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6050 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
|
6051 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
|
6052 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
|
6053 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
|
6054 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
|
6055 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
|
6056 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
|
6057 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
|
6058 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
|
6059 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
|
6060 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
|
6061 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
|
6062 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
|
6063 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
|
6064 radio_property verticalalignment , "top|{middle}|bottom" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6065 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6066 // 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
|
6067 bool_property __focus__ h , "off" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6068 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
|
6069 END_PROPERTIES |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6070 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6071 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
|
6072 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
|
6073 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6074 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6075 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6076 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6077 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
|
6078 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
|
6079 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
|
6080 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
|
6081 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
|
6082 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
|
6083 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
|
6084 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
|
6085 m_cached_units = get_units (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6086 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6087 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6088 OCTINTERP_API void update_text_extent (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6089 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6090 void update_string () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6091 void update_fontname () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6092 void update_fontsize () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6093 void update_fontangle () |
23396
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
6094 { |
945b53af4655
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
23258
diff
changeset
|
6095 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
|
6096 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6097 void update_fontweight () { 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
|
6098 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6099 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
|
6100 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6101 OCTINTERP_API void update_units (); |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6102 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6103 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6104 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6105 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
|
6106 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
|
6107 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6108 public: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6109 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
|
6110 : 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
|
6111 { } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6112 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6113 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uicontrol) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6114 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6115 ~uicontrol () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6116 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6117 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6118 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6119 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6120 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6121 bool valid_object () 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
|
6122 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6123 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
|
6124 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6125 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
|
6126 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
|
6127 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
|
6128 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
|
6129 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6130 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6131 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6132 // --------------------------------------------------------------------- |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6133 |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6134 class OCTINTERP_API uibuttongroup : public base_graphics_object |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6135 { |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6136 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6137 |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6138 class OCTINTERP_API properties : public base_properties |
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 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6141 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6142 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
|
6143 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
|
6144 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6145 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
|
6146 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6147 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
|
6148 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
|
6149 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
|
6150 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6151 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
|
6152 get___fontsize_points__ (double box_pix_height = 0) const; |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6153 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6154 // See the genprops.awk script for an explanation of the |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6155 // properties declarations. |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6156 // 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
|
6157 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6158 BEGIN_PROPERTIES (uibuttongroup) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
6159 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
|
6160 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|line" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6161 double_property borderwidth , 1 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6162 bool_property clipping , "on" |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
6163 radio_property fontangle , "{normal}|italic" |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6164 string_property fontname , OCTAVE_DEFAULT_FONTNAME |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6165 double_property fontsize , 10 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6166 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6167 radio_property fontweight , "{normal}|bold" |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6168 color_property foregroundcolor , color_values (0, 0, 0) |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6169 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
|
6170 array_property position S , default_panel_position () |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6171 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6172 // and has been replaced with "sizechangedfcn" |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6173 // 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
|
6174 callback_property resizefcn , Matrix () |
24120
0d446e938f1f
maint: clean up code formatting in generated graphics.h
Mike Miller <mtmiller@octave.org>
parents:
24071
diff
changeset
|
6175 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
|
6176 callback_property selectionchangedfcn , Matrix () |
25449
d2d9701d2dcb
Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents:
25436
diff
changeset
|
6177 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
|
6178 callback_property sizechangedfcn , Matrix () |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6179 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6180 string_property title , "" |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6181 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
|
6182 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6183 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6184 any_property __object__ h , Matrix () |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6185 END_PROPERTIES |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6186 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6187 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6188 void init () |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6189 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6190 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
|
6191 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
|
6192 m_fontsize.add_constraint ("min", 0.0, false); |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6193 } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6194 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6195 // void update_text_extent (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6196 // void update_string () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6197 // void update_fontname () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6198 // void update_fontsize () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6199 // void update_fontangle () { update_text_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6200 // void update_fontweight () { update_fontweight (); } |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6201 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6202 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
|
6203 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
|
6204 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6205 }; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6206 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6207 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
|
6208 properties m_properties; |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6209 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6210 public: |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6211 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
|
6212 : base_graphics_object (), m_properties (mh, p) |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6213 { } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6214 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6215 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uibuttongroup) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6216 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6217 ~uibuttongroup () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6218 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6219 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6220 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6221 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6222 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6223 bool valid_object () const { return true; } |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6224 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6225 bool has_readonly_property (const caseless_str& pname) const |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6226 { |
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 bool retval = m_properties.has_readonly_property (pname); |
21824
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6228 if (! retval) |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6229 retval = base_properties::has_readonly_property (pname); |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6230 return retval; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6231 } |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6232 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6233 }; |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6234 |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6235 // --------------------------------------------------------------------- |
6780a8657be3
Implement uibuttongroup (bug #47513)
Andrew Thornton <art27@cantab.net>
parents:
21789
diff
changeset
|
6236 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6237 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
|
6238 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6239 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6240 |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6241 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
|
6242 { |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6243 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6244 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6245 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
|
6246 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
|
6247 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
|
6248 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6249 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
|
6250 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
|
6251 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6252 // 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
|
6253 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6254 // 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
|
6255 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6256 BEGIN_PROPERTIES (uipanel) |
25429
ecc488aa56a0
Change default ui* objects color for compatibility (bug #53805)
Guillaume Flandin <guillaume.offline@gmail.com>
parents:
25425
diff
changeset
|
6257 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
|
6258 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
|
6259 double_property borderwidth , 1 |
28079
999351c323ce
remove deprecated "oblique" value from fontangle graphics property
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
6260 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
|
6261 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
|
6262 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
|
6263 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6264 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
|
6265 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
|
6266 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
|
6267 array_property position S , default_panel_position () |
26129
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6268 // FIXME: "resizefcn" is no longer recommended by Matlab, |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6269 // and has been replaced with "sizechangedfcn" |
3c61c8137664
Add sizechangedfcn property to uipanel objects.
Rik <rik@octave.org>
parents:
26125
diff
changeset
|
6270 // 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
|
6271 callback_property resizefcn , Matrix () |
25449
d2d9701d2dcb
Change default ShadowColor property to match Matlab (bug #53805).
Rik <rik@octave.org>
parents:
25436
diff
changeset
|
6272 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
|
6273 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
|
6274 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
|
6275 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
|
6276 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
|
6277 // Octave-specific properties |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6278 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
|
6279 END_PROPERTIES |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6280 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6281 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6282 void init () |
19861
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19834
diff
changeset
|
6283 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6284 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
|
6285 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
|
6286 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
|
6287 } |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18819
diff
changeset
|
6288 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6289 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
|
6290 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
|
6291 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6292 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6293 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6294 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
|
6295 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
|
6296 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6297 public: |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6298 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
|
6299 : 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
|
6300 { } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6301 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6302 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uipanel) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6303 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6304 ~uipanel () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6305 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6306 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6307 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6308 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6309 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6310 bool valid_object () 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
|
6311 |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6312 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
|
6313 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6314 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
|
6315 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
|
6316 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
|
6317 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
|
6318 } |
13281
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6319 }; |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6320 |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6321 // --------------------------------------------------------------------- |
834f904a3dcb
Add support for full asynchronous graphics toolkit running in a separate
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13236
diff
changeset
|
6322 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6323 class OCTINTERP_API uitable : public base_graphics_object |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6324 { |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6325 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6326 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6327 class OCTINTERP_API properties : public base_properties |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6328 { |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6329 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6330 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6331 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
|
6332 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
|
6333 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
|
6334 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6335 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
|
6336 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
|
6337 |
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6338 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
|
6339 get_fontsize_pixels (double box_pix_height = 0) const; |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6340 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6341 // See the genprops.awk script for an explanation of the |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6342 // properties declarations. |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6343 // 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
|
6344 |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6345 // FIXME: keypressfcn, keyreleasefcn, rearrangeablecolumns properties |
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6346 // seem to have been removed from Matlab. |
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6347 |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6348 BEGIN_PROPERTIES (uitable) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6349 any_property __object__ h , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6350 array_property backgroundcolor , default_table_backgroundcolor () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6351 callback_property celleditcallback , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6352 callback_property cellselectioncallback , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6353 row_vector_property columneditable , Matrix () |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6354 any_property columnformat S , Cell () |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6355 any_property columnname , "numbered" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6356 any_property columnwidth S , "auto" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6357 any_property data u , Matrix () |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6358 bool_property enable , "on" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6359 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
|
6360 radio_property fontangle u , "{normal}|italic" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6361 string_property fontname u , OCTAVE_DEFAULT_FONTNAME |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6362 double_property fontsize u , 10 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6363 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels" |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6364 radio_property fontweight u , "{normal}|bold" |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6365 color_property foregroundcolor , color_values (0, 0, 0) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6366 callback_property keypressfcn , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6367 callback_property keyreleasefcn , Matrix () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6368 array_property position , default_table_position () |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6369 bool_property rearrangeablecolumns , "off" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6370 any_property rowname , "numbered" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6371 bool_property rowstriping , "on" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6372 string_property tooltipstring , "" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6373 radio_property units S , "normalized|inches|centimeters|points|{pixels}|characters" |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6374 END_PROPERTIES |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6375 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6376 OCTINTERP_API Matrix get_extent_matrix () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6377 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6378 OCTINTERP_API Matrix get_backgroundcolor_rgb (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6379 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6380 OCTINTERP_API Matrix get_alternatebackgroundcolor_rgb (); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6381 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6382 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6383 void init () |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6384 { |
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 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
|
6386 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
|
6387 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
|
6388 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
|
6389 m_columneditable.add_constraint ("logical"); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6390 } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6391 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6392 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
|
6393 OCTINTERP_API void update_fontunits (const caseless_str& old_units); |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6394 void update_table_extent () { }; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6395 void update_data () { update_table_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6396 void update_fontname () { update_table_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6397 void update_fontsize () { update_table_extent (); } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6398 void update_fontangle () |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6399 { |
26275
dd97dc559679
maint: Remove deprecated graphics properties.
Rik <rik@octave.org>
parents:
26194
diff
changeset
|
6400 update_table_extent (); |
26122
4d1c6c60f6b3
Clean up implementation of uitable in 36e0e5b428e7.
Rik <rik@octave.org>
parents:
26112
diff
changeset
|
6401 } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6402 void update_fontweight () { update_table_extent (); } |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6403 }; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6404 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6405 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
|
6406 properties m_properties; |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6407 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6408 public: |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6409 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
|
6410 : base_graphics_object (), m_properties (mh, p) |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6411 { } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6412 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6413 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitable) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6414 |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6415 ~uitable () = default; |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6416 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6417 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6418 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6419 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6420 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6421 bool valid_object () const { return true; } |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6422 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6423 bool has_readonly_property (const caseless_str& pname) const |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6424 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6425 bool retval = m_properties.has_readonly_property (pname); |
26112
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6426 if (! retval) |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6427 retval = base_properties::has_readonly_property (pname); |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6428 return retval; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6429 } |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6430 }; |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6431 |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6432 // --------------------------------------------------------------------- |
36e0e5b428e7
Implement uitable (patch #9084)
Andrew Thornton <art27@cantab.net>
parents:
26107
diff
changeset
|
6433 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6434 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
|
6435 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6436 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6437 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6438 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
|
6439 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6440 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6441 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6442 // 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
|
6443 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6444 // 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
|
6445 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6446 BEGIN_PROPERTIES (uitoolbar) |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6447 // 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
|
6448 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
|
6449 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6450 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6451 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6452 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6453 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6454 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6455 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6456 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
|
6457 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6458 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6459 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6460 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
|
6461 : 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
|
6462 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6463 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6464 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitoolbar) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6465 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6466 ~uitoolbar () = default; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6467 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6468 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
|
6469 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6470 // 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
|
6471 // 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
|
6472 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
|
6473 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6474 // 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
|
6475 // 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
|
6476 // 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
|
6477 // 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
|
6478 // 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
|
6479 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
|
6480 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6481 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6482 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
|
6483 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6484 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
|
6485 // 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
|
6486 // 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
|
6487 // 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
|
6488 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
|
6489 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
|
6490 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
|
6491 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6492 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6493 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
|
6494 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6495 octave_value retval; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6496 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6497 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
|
6498 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
|
6499 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
|
6500 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
|
6501 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6502 return retval; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6503 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6504 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6505 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
|
6506 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6507 octave_value get_defaults () const |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6508 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6509 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
|
6510 } |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6511 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6512 property_list get_defaults_list () const |
19666
e7df12f37f71
Freset: avoid multiple reseting of properties (bug #43960)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19663
diff
changeset
|
6513 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6514 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
|
6515 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6516 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6517 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6518 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6519 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6520 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6521 bool valid_object () const { return true; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6522 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6523 OCTINTERP_API void reset_default_properties (); |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6524 |
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
|
6525 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
|
6526 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6527 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
|
6528 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
|
6529 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
|
6530 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
|
6531 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6532 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6533 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
|
6534 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
|
6535 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6536 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6537 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6538 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6539 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
|
6540 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6541 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6542 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6543 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
|
6544 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6545 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6546 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6547 // 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
|
6548 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6549 // 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
|
6550 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6551 BEGIN_PROPERTIES (uipushtool) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6552 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
|
6553 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
|
6554 bool_property enable , "on" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6555 bool_property separator , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6556 string_property tooltipstring , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6557 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6558 // 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
|
6559 string_property __named_icon__ , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6560 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
|
6561 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6562 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6563 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6564 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6565 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6566 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
|
6567 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
|
6568 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
|
6569 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
|
6570 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
|
6571 } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6572 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6573 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6574 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
|
6575 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6576 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6577 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6578 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
|
6579 : 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
|
6580 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6581 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6582 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uipushtool) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6583 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6584 ~uipushtool () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6585 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6586 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6587 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6588 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6589 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6590 bool valid_object () const { return true; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6591 |
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
|
6592 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
|
6593 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6594 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
|
6595 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
|
6596 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
|
6597 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
|
6598 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6599 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6600 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6601 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6602 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6603 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6604 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
|
6605 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6606 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6607 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6608 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
|
6609 { |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6610 public: |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6611 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6612 // 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
|
6613 // properties declarations. |
17099
a033fd3669c0
Alphabetize graphic properties and add properties missing from Matlab.
Rik <rik@octave.org>
parents:
17098
diff
changeset
|
6614 // 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
|
6615 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6616 BEGIN_PROPERTIES (uitoggletool) |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6617 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
|
6618 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
|
6619 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
|
6620 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
|
6621 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
|
6622 bool_property separator , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6623 bool_property state , "off" |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6624 string_property tooltipstring , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6625 |
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6626 // 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
|
6627 string_property __named_icon__ , "" |
24452
55ddb7a4cca2
Create "pickableparts" as a base graphics property.
Rik <rik@octave.org>
parents:
24451
diff
changeset
|
6628 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
|
6629 END_PROPERTIES |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6630 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6631 protected: |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6632 void init () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6633 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6634 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
|
6635 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
|
6636 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
|
6637 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
|
6638 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
|
6639 } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6640 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6641 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6642 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
|
6643 properties m_properties; |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6644 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6645 public: |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6646 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
|
6647 : 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
|
6648 { } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6649 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6650 OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (uitoggletool) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6651 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6652 ~uitoggletool () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6653 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6654 base_properties& get_properties () { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6655 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6656 const base_properties& get_properties () const { return m_properties; } |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6657 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6658 bool valid_object () const { return true; } |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6659 |
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
|
6660 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
|
6661 { |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6662 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
|
6663 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
|
6664 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
|
6665 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
|
6666 } |
8d5cb159fbc7
Add methods to determine if a graphic property is read-only (bug #41629).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18119
diff
changeset
|
6667 |
13703
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6668 }; |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6669 |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
diff
changeset
|
6670 // --------------------------------------------------------------------- |
22ce748da25f
Add missing UI objects: uicontextmenu, uitoolbar, uipushtool and uitoggletool.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13699
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 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
|
6673 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
|
6674 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
|
6675 OCTINTERP_API bool |
18119
ec9b35e60f95
style fixes in graphics.in.h and graphics.cc
John W. Eaton <jwe@octave.org>
parents:
18118
diff
changeset
|
6676 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
|
6677 const octave_value& arg, const std::string& fcn); |
6874 | 6678 |
6679 // --------------------------------------------------------------------- | |
6680 | |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6681 class graphics_event; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6682 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
32598
diff
changeset
|
6683 class OCTINTERP_API base_graphics_event |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6684 { |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6685 public: |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6686 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
|
6687 |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6688 friend class graphics_event; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6689 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6690 base_graphics_event () |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6691 : 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
|
6692 { }; |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6693 |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6694 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
|
6695 : 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
|
6696 { }; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6697 |
31855
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6698 OCTAVE_DEFAULT_COPY_MOVE (base_graphics_event) |
1daf8bfceac3
default or disable more ctors, dtors, and assignment ops
John W. Eaton <jwe@octave.org>
parents:
31837
diff
changeset
|
6699 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6700 virtual ~base_graphics_event () = default; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6701 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6702 int get_busyaction () { return m_busyaction; }; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6703 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6704 virtual void execute () = 0; |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6705 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
6706 private: |
25960
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6707 int m_busyaction; |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6708 }; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6709 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
32598
diff
changeset
|
6710 class OCTINTERP_API graphics_event |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6711 { |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6712 public: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6713 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30299
diff
changeset
|
6714 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
|
6715 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6716 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
|
6717 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6718 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
|
6719 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
6720 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
|
6721 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6722 ~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
|
6723 |
24991
831389905438
omit argument name from default copy ctors and assignment operators
John W. Eaton <jwe@octave.org>
parents:
24795
diff
changeset
|
6724 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
|
6725 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6726 int 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
|
6727 { |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6728 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
|
6729 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
|
6730 else |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6731 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
|
6732 } |
ae9d6a491c06
Refactor graphics event handling and fix interruption of callbacks (bug #54340)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25903
diff
changeset
|
6733 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6734 void execute () |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6735 { |
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6736 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
|
6737 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
|
6738 } |
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6739 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6740 bool ok () const { return (m_rep != nullptr); } |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6741 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6742 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6743 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
|
6744 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
|
6745 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
|
6746 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
|
6747 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6748 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6749 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
|
6750 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
|
6751 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
|
6752 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
|
6753 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6754 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
|
6755 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
|
6756 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
|
6757 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6758 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
|
6759 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
|
6760 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6761 static OCTINTERP_API graphics_event |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
6762 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
|
6763 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
|
6764 bool redraw_figure = false); |
7964
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6765 private: |
24252
f8c263f961c1
use shared_ptr to manage graphics_object and graphics_event objects
John W. Eaton <jwe@octave.org>
parents:
24191
diff
changeset
|
6766 |
29889
3ab696e02f55
use m_ prefix for data members in graphics objects and properties classes
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
6767 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
|
6768 }; |
9cd3ee5298a0
Use common rep/class pattern for graphics events
John W. Eaton <jwe@octave.org>
parents:
7936
diff
changeset
|
6769 |
31663
a74935a6cc75
move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents:
31606
diff
changeset
|
6770 OCTINTERP_API base_graphics_object * |
a74935a6cc75
move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents:
31606
diff
changeset
|
6771 make_graphics_object_from_type (const caseless_str& type, |
a74935a6cc75
move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents:
31606
diff
changeset
|
6772 const graphics_handle& h = graphics_handle (), |
a74935a6cc75
move gh_manager class out of graphics.in.h and graphics.cc to separate files
John W. Eaton <jwe@octave.org>
parents:
31606
diff
changeset
|
6773 const graphics_handle& p = graphics_handle ()); |
6874 | 6774 |
29233
665c9ed14c97
Set API tags in files in libinterp/corefcn (patch #8919).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29163
diff
changeset
|
6775 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
|
6776 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
|
6777 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
|
6778 const Matrix& kids, char limit_type); |
6874 | 6779 |
10917
888c75785221
Improvements to FLTK backend rotation
Jordi Guti?rrez Hermoso <jordigh@gmail.com>
parents:
10792
diff
changeset
|
6780 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
|
6781 |
6874 | 6782 // This function is NOT equivalent to the scripting language function gcf. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6783 OCTINTERP_API graphics_handle gcf (); |
6874 | 6784 |
6785 // This function is NOT equivalent to the scripting language function gca. | |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6786 OCTINTERP_API graphics_handle gca (); |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6787 |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31707
diff
changeset
|
6788 OCTINTERP_API void close_all_figures (); |
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
|
6789 |
31605
e88a07dec498
maint: Use macros to begin/end C++ namespaces.
Rik <rik@octave.org>
parents:
31241
diff
changeset
|
6790 OCTAVE_END_NAMESPACE(octave) |
29993
b5fae48ad807
move classes for graphics objects and properties inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29913
diff
changeset
|
6791 |
6874 | 6792 #endif |