diff doc/interpreter/geometryimages.m @ 6855:a052825889a0

[project @ 2007-09-01 00:08:16 by dbateman]
author dbateman
date Sat, 01 Sep 2007 00:08:16 +0000
parents 956148c0d388
children ceb2e732b0fb
line wrap: on
line diff
--- a/doc/interpreter/geometryimages.m	Sat Sep 01 00:03:10 2007 +0000
+++ b/doc/interpreter/geometryimages.m	Sat Sep 01 00:08:16 2007 +0000
@@ -1,6 +1,10 @@
 function geometryimages (nm, typ)
   bury_output ();
-  if (strcmp (nm, "voronoi"))
+  if (isempty (findstr (octave_config_info ("DEFS"), "HAVE_QHULL")) && ...
+      (strcmp (nm, "voronoi") || strcmp (nm, "griddata") || ...
+       strcmp (nm, "convhull") || strcmp (nm, "delaunay")))
+    sombreroimage (nm, typ);
+  elseif (strcmp (nm, "voronoi"))
     rand("state",9);
     x = rand(10,1);
     y = rand(10,1);
@@ -141,3 +145,30 @@
   f = figure (1);
   set (f, "visible", "off");
 endfunction
+
+function sombreroimage (nm, typ)
+  if (strcmp (typ, "txt"))
+    fid = fopen (sprintf ("%s.txt", nm), "wt");
+    fputs (fid, "+-----------------------------+\n");
+    fputs (fid, "| Image unavailable because   |\n");
+    fputs (fid, "| of a missing QHULL library. |\n");
+    fputs (fid, "+-----------------------------+\n");
+    fclose (fid);
+    return;
+  else ## if (!strcmp (typ, "txt"))
+
+    bury_output ();
+
+    x = y = linspace (-8, 8, 41)';
+    [xx, yy] = meshgrid (x, y);
+    r = sqrt (xx .^ 2 + yy .^ 2) + eps;
+    z = sin (r) ./ r;
+    unwind_protect
+      mesh (x, y, z);
+      title ("Sorry, graphics not available because octave was\\ncompiled without the QHULL library.");
+    unwind_protect_cleanup
+      print (strcat (nm, ".", typ), strcat ("-d", typ));
+      bury_output ();
+    end_unwind_protect
+  endif
+endfunction