1## Copyright (C) 2007, 2008, 2009 Michael Goffioul
3## This file is part of Octave.
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
7## the Free Software Foundation; either version 3 of the License, or (at
8## your option) any later version.
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.
15## You should have received a copy of the GNU General Public License
16## along with Octave; see the file COPYING. If not, see
17## <http://www.gnu.org/licenses/>.
20## @deftypefn {Function File} {} hidden (@var{mode})
21## @deftypefnx {Function File} {} hidden ()
22## Manipulation the mesh hidden line removal. Called with no argument
23## the hidden line removal is toggled. The argument @var{mode} can be either
24## 'on' or 'off' and the set of the hidden line removal is set accordingly.
25## @seealso{mesh, meshc, surf}
28function retval = hidden (mode)
34 mode = tolower (mode);
35 if (! strcmp (mode, "on") && ! strcmp (mode, "off"))
36 error ("hidden: mode expected to be 'on' or 'off'");
39 error ("hidden: expecting mode to be a string");
45 for h = get (gca (), "children");
46 htype = lower (get (h, "type"));
47 if (strcmp (htype, "surface"))
48 fc = get (h, "facecolor");
49 if ((! ischar (fc) && is_white (fc))
50 || (ischar (fc) && strcmpi (fc, "none")))
53 set (h, "facecolor", "w");
55 set (h, "facecolor", "none");
58 set (h, "facecolor", "w");
61 set (h, "facecolor", "none");
75function retval = is_white (color)
76 retval = all (color == 1);