7017
|
1 ## Copyright (C) 2005, 2007 John W. Eaton |
6405
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
6405
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
6405
|
18 |
6895
|
19 ## Undocumented internal function. |
|
20 |
|
21 ## __line__ (p, x, y, z) |
|
22 ## Create line object from x, y, and z with parent p. |
6405
|
23 ## Return handle to line object. |
|
24 |
|
25 ## Author: jwe |
|
26 |
|
27 function h = __line__ (p, varargin) |
|
28 |
|
29 if (nargin < 1) |
|
30 print_usage (); |
|
31 endif |
|
32 |
|
33 nvargs = numel (varargin); |
|
34 |
|
35 if (nvargs > 1 && isnumeric (varargin{1}) && isnumeric (varargin{2})) |
|
36 if (nvargs > 2 && isnumeric (varargin{3})) |
|
37 num_data_args = 3; |
|
38 else |
|
39 num_data_args = 2; |
|
40 endif |
|
41 else |
|
42 num_data_args = 0; |
|
43 endif |
|
44 |
|
45 if (rem (nvargs - num_data_args, 2) == 0) |
|
46 else |
|
47 print_usage ("line"); |
|
48 endif |
|
49 |
7277
|
50 data_args = {}; |
6405
|
51 if (num_data_args > 1) |
7277
|
52 data_args(1:4) = { "xdata", varargin{1}, "ydata", varargin{2} }; |
6405
|
53 if (num_data_args == 3) |
7277
|
54 data_args(5:6) = { "zdata", varargin{3} }; |
6405
|
55 endif |
|
56 endif |
|
57 |
7277
|
58 other_args = {}; |
6405
|
59 if (nvargs > num_data_args) |
7277
|
60 other_args = varargin(num_data_args+1:end); |
6405
|
61 endif |
|
62 |
7277
|
63 h = __go_line__ (p, data_args{:}, other_args{:}); |
|
64 |
6405
|
65 endfunction |