annotate scripts/plot/private/__patch__.m @ 14552:86854d032a37

maint: miscellaneous style fixes for .m files * audio/mu2lin.m, deprecated/cut.m, general/cplxpair.m, general/genvarname.m, geometry/rectint.m, help/gen_doc_cache.m, image/hsv2rgb.m, image/rainbow.m, io/textscan.m, miscellaneous/bzip2.m, miscellaneous/compare_versions.m, miscellaneous/fact.m, miscellaneous/menu.m, optimization/fminbnd.m, optimization/fminunc.m, optimization/fzero.m, optimization/sqp.m, plot/__gnuplot_drawnow__.m, plot/axis.m, plot/findobj.m, plot/legend.m, plot/peaks.m, plot/private/__errplot__.m, plot/private/__fltk_print__.m, plot/private/__go_draw_axes__.m, plot/private/__patch__.m, polynomial/pchip.m, polynomial/residue.m, signal/periodogram.m, sparse/sprandsym.m, statistics/base/moment.m, statistics/distributions/expcdf.m, statistics/distributions/expinv.m, statistics/distributions/exppdf.m, statistics/tests/prop_test_2.m, statistics/tests/sign_test.m, statistics/tests/t_test.m, statistics/tests/t_test_2.m, statistics/tests/t_test_regression.m, strings/regexptranslate.m, time/datetick.m: Style fixes.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Apr 2012 22:07:00 -0400
parents 72c96de7a403
children 5d3a684236b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 14109
diff changeset
1 ## Copyright (C) 2007-2012 John W. Eaton, Shai Ayal, Kai Habel
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
2 ##
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
4 ##
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6925
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6925
diff changeset
8 ## your option) any later version.
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
9 ##
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
14 ##
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6925
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6925
diff changeset
17 ## <http://www.gnu.org/licenses/>.
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
18
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
19 ## -*- texinfo -*-
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
20 ## @deftypefn {Function File} {[@var{h}, @var{fail}] =} __patch__ (@var{p}, @dots{})
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6886
diff changeset
21 ## Undocumented internal function.
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8190
diff changeset
22 ## @end deftypefn
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6886
diff changeset
23
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6886
diff changeset
24 ## __patch__ (p, x, y, c)
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6886
diff changeset
25 ## Create patch object from x and y with color c and parent p.
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
26 ## Return handle to patch object.
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
27
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
28 ## Author: Kai Habel
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
29
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
30 function [h, failed] = __patch__ (p, varargin)
7191
b48a21816f2e [project @ 2007-11-26 21:24:32 by jwe]
jwe
parents: 7189
diff changeset
31
13954
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
32 h = NaN;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
33 failed = false;
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
34
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
35 is_numeric_arg = cellfun (@isnumeric, varargin);
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
36
13115
cd808de114c1 Allow surface and patch to be called w/o arguments. Adding and fixing tests.
Kai Habel <kai.habel@gmx.de>
parents: 12931
diff changeset
37 if (isempty (varargin))
13809
425b861ae66f use compatible defaults for patch function
John W. Eaton <jwe@octave.org>
parents: 13808
diff changeset
38 args = {"xdata", [0; 1; 0], "ydata", [1; 1; 0], "facecolor", [0, 0, 0]};
13115
cd808de114c1 Allow surface and patch to be called w/o arguments. Adding and fixing tests.
Kai Habel <kai.habel@gmx.de>
parents: 12931
diff changeset
39 args = setvertexdata (args);
cd808de114c1 Allow surface and patch to be called w/o arguments. Adding and fixing tests.
Kai Habel <kai.habel@gmx.de>
parents: 12931
diff changeset
40 elseif (isstruct (varargin{1}))
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
41 if (isfield (varargin{1}, "vertices") && isfield (varargin{1}, "faces"))
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
42 args{1} = "faces";
9111
David Bateman <dbateman@free.fr>
parents: 9110
diff changeset
43 args{2} = getfield(varargin{1}, "faces");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
44 args{3} = "vertices";
9111
David Bateman <dbateman@free.fr>
parents: 9110
diff changeset
45 args{4} = getfield(varargin{1}, "vertices");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
46 args{5} = "facevertexcdata";
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
47 if (isfield (varargin{1}, "facevertexcdata"))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
48 args{6} = getfield(varargin{1}, "facevertexcdata");
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
49 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
50 args{6} = [];
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
51 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
52 args = [args; varargin(2:end)];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
53 args = setdata (args);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
54 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
55 failed = true;
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
56 endif
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
57 elseif (is_numeric_arg(1))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
58 if (nargin < 3 || ! is_numeric_arg(2))
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
59 failed = true;
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
60 else
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
61
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
62 if (nargin > 4 && all (is_numeric_arg(1:4)))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
63 x = varargin{1};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
64 y = varargin{2};
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
65 z = varargin{3};
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
66 c = varargin{4};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
67 iarg = 5;
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
68 elseif (nargin > 3 && all (is_numeric_arg(1:3)))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
69 x = varargin{1};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
70 y = varargin{2};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
71 iarg = 4;
13308
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
72 if (rem (nargin - iarg, 2) == 1)
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
73 c = varargin {iarg};
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
74 z = varargin{3};
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
75 iarg = 5;
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
76 else
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
77 z = [];
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
78 c = varargin{3};
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
79 endif
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
80 elseif (nargin > 2 && all (is_numeric_arg(1:2)))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
81 x = varargin{1};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
82 y = varargin{2};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
83 z = [];
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
84 iarg = 3;
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
85 if (rem (nargin - iarg, 2) == 1)
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
86 c = varargin {iarg};
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
87 iarg++;
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
88 else
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
89 c = [];
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
90 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
91 endif
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
92
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
93 if (isvector (x))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
94 x = x(:);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
95 y = y(:);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
96 z = z(:);
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
97 if (isnumeric (c))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
98 if (isvector (c) && numel (c) == numel (x))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
99 c = c(:);
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
100 elseif (size (c, 1) != numel (x) && size (c, 2) == numel (x))
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
101 c = c.';
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
102 endif
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
103 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
104 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
105 args{1} = "xdata";
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
106 args{2} = x;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
107 args{3} = "ydata";
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
108 args{4} = y;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
109 args{5} = "zdata";
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
110 args{6} = z;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
111
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
112 if (isnumeric (c))
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
113
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
114 if (ndims (c) == 3 && size (c, 2) == 1)
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
115 c = permute (c, [1, 3, 2]);
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
116 endif
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
117
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
118 if (isvector (c) && numel (c) == columns (x))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
119 if (isnan (c))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
120 args{7} = "facecolor";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
121 args{8} = [1, 1, 1];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
122 args{9} = "cdata";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
123 args{10} = c;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
124 elseif (isnumeric (c))
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
125 args{7} = "facecolor";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
126 args{8} = "flat";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
127 args{9} = "cdata";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
128 args{10} = c;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
129 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
130 error ("patch: color value not valid");
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
131 endif
13954
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
132 elseif (isvector (c) && numel (c) == 3)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
133 args{7} = "facecolor";
13808
d5bfaa582eaa correctly handle RGB color spec for patch object
John W. Eaton <jwe@octave.org>
parents: 13779
diff changeset
134 args{8} = c;
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
135 args{9} = "cdata";
13808
d5bfaa582eaa correctly handle RGB color spec for patch object
John W. Eaton <jwe@octave.org>
parents: 13779
diff changeset
136 args{10} = [];
13954
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
137 elseif (ndims (c) == 3 && size (c, 3) == 3)
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
138 ## CDATA is specified as RGB data
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
139 if ((size (c, 1) == 1 && size (c, 2) == 1) ...
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
140 || (size (c, 1) == 1 && size (c, 2) == columns (x)))
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
141 ## Single patch color or per-face color
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
142 args{7} = "facecolor";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
143 args{8} = "flat";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
144 args{9} = "cdata";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
145 args{10} = c;
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
146 elseif (size (c, 1) == rows (x) && size (c, 2) == columns (x))
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
147 ## Per-vertex color
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
148 args{7} = "facecolor";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
149 args{8} = "interp";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
150 args{9} = "cdata";
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
151 agrs{10} = c;
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
152 else
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
153 error ("patch: color value not valid");
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
154 endif
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
155 else
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
156 ## Color Vectors
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
157 if (isempty (c))
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
158 args{7} = "facecolor";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
159 args{8} = "interp";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
160 args{9} = "cdata";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
161 args{10} = [];
13308
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
162 elseif (isequal (size (c), size (x)) && isequal (size (c), size (y)))
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
163 args{7} = "facecolor";
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
164 args{8} = "interp";
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
165 args{9} = "cdata";
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
166 args{10} = c;
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
167 else
13308
9a83ec29aec9 Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents: 13299
diff changeset
168 error ("patch: size of x, y, and c must be equal");
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
169 endif
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
170 endif
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
171 elseif (ischar (c) && rem (nargin - iarg, 2) == 0)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
172 ## Assume that any additional argument over an even number is
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
173 ## color string.
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
174 args{7} = "facecolor";
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
175 args{8} = tolower (c);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
176 args{9} = "cdata";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
177 args{10} = [];
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
178 else
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
179 args{7} = "facecolor";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
180 args{8} = [0, 1, 0];
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
181 args{9} = "cdata";
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10524
diff changeset
182 args{10} = [];
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6895
diff changeset
183 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
184
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
185 args = [args, varargin(iarg:end)];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
186 args = setvertexdata (args);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
187 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
188 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
189 args = varargin;
12931
cefd568ea073 Replace function handles with function names in cellfun calls for 15% speedup.
Rik <octave@nomad.inbox5.com>
parents: 11589
diff changeset
190 if (any (strcmpi (args, "faces") | strcmpi (args, "vertices")))
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
191 args = setdata (args);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
192 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
193 args = setvertexdata (args);
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
194 endif
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
195 endif
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6807
diff changeset
196
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
197 if (!failed)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
198 h = __go_patch__ (p, args {:});
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
199
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
200 ## Setup listener functions
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
201 addlistener (h, "xdata", @update_data);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
202 addlistener (h, "ydata", @update_data);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
203 addlistener (h, "zdata", @update_data);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
204 addlistener (h, "cdata", @update_data);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
205
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
206 addlistener (h, "faces", @update_fvc);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
207 addlistener (h, "vertices", @update_fvc);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
208 addlistener (h, "facevertexcdata", @update_fvc);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
209 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
210 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
211
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
212 function args = delfields(args, flds)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
213 idx = cellfun (@(x) any (strcmpi (x, flds)), args);
10569
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
214 if (rows (idx) == 1)
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
215 idx = idx | [false, idx(1:end-1)];
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
216 else
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
217 idx = idx | [false; idx(1:end-1)];
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
218 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
219 args (idx) = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
220 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
221
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
222 function args = setdata (args)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
223 args = delfields (args, {"xdata", "ydata", "zdata", "cdata"});
10569
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
224 ## Remove the readonly fields as well
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
225 args = delfields (args, {"type", "uicontextmenu"});
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
226 nargs = length (args);
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
227 idx = find (strcmpi (args, "faces"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
228 if (idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
229 faces = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
230 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
231 faces = args {idx};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
232 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
233 idx = find (strcmpi (args, "vertices"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
234 if (idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
235 vert = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
236 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
237 vert = args {idx};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
238 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
239 idx = find (strcmpi (args, "facevertexcdata"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
240 if (isempty(idx) || idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
241 fvc = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
242 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
243 fvc = args {idx};
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
244 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
245 idx = find (strcmpi (args, "facecolor"), 1, "last") + 1;
9118
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
246 if (isempty(idx) || idx > nargs)
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
247 if (!isempty (fvc))
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
248 fc = "flat";
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
249 else
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
250 fc = [0, 1, 0];
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
251 endif
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
252 args = {"facecolor", fc, args{:}};
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
253 endif
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
254
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
255 nc = size (faces, 1);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
256 idx = faces .';
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
257 t1 = isnan (idx);
13779
7c0fcabd1a66 __patch__: fix thinko in previous change.
John W. Eaton <jwe@octave.org>
parents: 13778
diff changeset
258 for i = find (any (t1))
7c0fcabd1a66 __patch__: fix thinko in previous change.
John W. Eaton <jwe@octave.org>
parents: 13778
diff changeset
259 first_idx_in_column = find (t1(:,i), 1);
7c0fcabd1a66 __patch__: fix thinko in previous change.
John W. Eaton <jwe@octave.org>
parents: 13778
diff changeset
260 idx(first_idx_in_column:end,i) = idx(first_idx_in_column-1,i);
13778
b0b6aa4f7302 __patch__: correctly replace NaN values with last non-NaN value in column
John W. Eaton <jwe@octave.org>
parents: 13698
diff changeset
261 endfor
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
262 x = reshape (vert(:,1)(idx), size (idx));
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
263 y = reshape (vert(:,2)(idx), size (idx));
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
264 if (size(vert,2) > 2)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
265 z = reshape (vert(:,3)(idx), size (idx));
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
266 else
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
267 z = [];
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
268 endif
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
269
11160
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
270 if (size(fvc, 1) == nc || size (fvc, 1) == 1)
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
271 c = reshape (fvc, [1, size(fvc)]);
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
272 else
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
273 if (size(fvc, 2) == 3)
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
274 c = cat(3, reshape (fvc(idx, 1), size(idx)),
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
275 reshape (fvc(idx, 2), size(idx)),
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
276 reshape (fvc(idx, 3), size(idx)));
14108
5be545210fe3 Trisurf() improvements.
Ben Abbott <bpabbott@mac.com>
parents: 13954
diff changeset
277 elseif (isempty (fvc))
14109
9627d5134a12 __patch__.m: Terminate line with semicolon.
Ben Abbott <bpabbott@mac.com>
parents: 14108
diff changeset
278 c = [];
14108
5be545210fe3 Trisurf() improvements.
Ben Abbott <bpabbott@mac.com>
parents: 13954
diff changeset
279 else ## if (size (fvc, 2) == 1)
5be545210fe3 Trisurf() improvements.
Ben Abbott <bpabbott@mac.com>
parents: 13954
diff changeset
280 c = permute (fvc(faces), [2, 1]);
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
281 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
282 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
283 args = {"xdata", x, "ydata", y, "zdata", z, "cdata", c, args{:}};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
284 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
285
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
286 function args = setvertexdata (args)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
287 args = delfields (args, {"vertices", "faces", "facevertexcdata"});
10569
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
288 ## Remove the readonly fields as well
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
289 args = delfields (args, {"type", "uicontextmenu"});
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
290 nargs = length (args);
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
291 idx = find (strcmpi (args, "xdata"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
292 if (idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
293 x = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
294 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
295 x = args {idx};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
296 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
297 idx = find (strcmpi (args, "ydata"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
298 if (idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
299 y = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
300 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
301 y = args {idx};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
302 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
303 idx = find (strcmpi (args, "zdata"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
304 if (isempty(idx) || idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
305 z = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
306 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
307 z = args {idx};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
308 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
309 idx = find (strcmpi (args, "cdata"), 1, "last") + 1;
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
310 if (isempty(idx) || idx > nargs)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
311 c = [];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
312 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
313 c = args {idx};
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
314 endif
11188
4cb1522e4d0f Use function handle as input to cellfun,
Rik <octave@nomad.inbox5.com>
parents: 11187
diff changeset
315 idx = find (strcmpi (args, "facecolor"), 1, "last") + 1;
9118
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
316 if (isempty(idx) || idx > nargs)
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
317 if (!isempty (c))
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
318 fc = "flat";
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
319 else
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
320 fc = [0, 1, 0];
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
321 endif
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
322 args = {"facecolor", fc, args{:}};
308311b642b2 Explicitly set the default facecolor of patches
David Bateman <dbateman@free.fr>
parents: 9111
diff changeset
323 endif
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
324
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
325 [nr, nc] = size (x);
13954
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
326 if (nr == 1 && nc > 1)
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
327 nr = nc;
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
328 nc = 1;
14552
86854d032a37 maint: miscellaneous style fixes for .m files
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
329 endif
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
330 if (!isempty (z))
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
331 vert = [x(:), y(:), z(:)];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
332 else
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
333 vert = [x(:), y(:)];
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
334 endif
13954
2ebbc6c9961b [Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13809
diff changeset
335 faces = reshape (1:numel(x), nr, nc);
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
336 faces = faces';
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
337
11160
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
338 if (ndims (c) == 3)
131d56b6d9a3 Set cdata from facevertexcdata and visa versa for patch at all times
David Bateman <dbateman@free.fr>
parents: 10569
diff changeset
339 fvc = reshape (c, size (c, 1) * size (c, 2), size(c, 3));
14108
5be545210fe3 Trisurf() improvements.
Ben Abbott <bpabbott@mac.com>
parents: 13954
diff changeset
340 else
13299
e9f6a6edec42 Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents: 13256
diff changeset
341 fvc = c(:);
7020
e31f12bb9194 [project @ 2007-10-13 05:13:28 by dbateman]
dbateman
parents: 7016
diff changeset
342 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
343
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
344 args = {"faces", faces, "vertices", vert, "facevertexcdata", fvc, args{:}};
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
345 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
346
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
347 function update_data (h, d)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
348 update_handle (h, false);
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
349 endfunction
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
350
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
351 function update_fvc (h, d)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
352 update_handle (h, true);
6807
0089a504fdd6 [project @ 2007-08-10 17:34:59 by jwe]
jwe
parents:
diff changeset
353 endfunction
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
354
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
355 function update_handle (h, isfv)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
356 persistent recursive = false;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
357
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
358 if (! recursive)
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
359 recursive = true;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
360 f = get (h);
10524
1c6ff93c025a Reimplement the other discrete distribution functions using lookup
David Bateman <dbateman@free.fr>
parents: 9896
diff changeset
361 if (isfv)
10569
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
362 set (h, setdata ([fieldnames(f), struct2cell(f)].'(:)){:});
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
363 else
10569
4f2e46473153 Fix the order of calling setdata and setvertexdata for patches (bug #29549)
David Bateman <dbateman@free.fr>
parents: 10549
diff changeset
364 set (h, setvertexdata ([fieldnames(f), struct2cell(f)].'(:)){:});
9110
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
365 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
366 recursive = false;
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
367 endif
22ae6b3411a7 Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents: 8920
diff changeset
368 endfunction