changeset 6829:6c85f7d37e61

[project @ 2007-08-24 20:23:21 by dbateman]
author dbateman
date Fri, 24 Aug 2007 20:26:24 +0000
parents d069de22e9aa
children abe21f30e1fe
files ChangeLog configure.in scripts/ChangeLog scripts/plot/__go_draw_axes__.m src/ChangeLog src/graphics.cc src/graphics.h src/symtab.cc
diffstat 8 files changed, 176 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 24 16:59:48 2007 +0000
+++ b/ChangeLog	Fri Aug 24 20:26:24 2007 +0000
@@ -1,3 +1,7 @@
+2007-08-24  David Bateman  <dbateman@free.fr>
+
+	* configure.in: Extra Qhull bits.
+
 2007-08-24  Kim Hansen  <kimhanse@gmail.com>
 
 	* run-octave.in: Use `command` instead of $(command) to accomodate
--- a/configure.in	Fri Aug 24 16:59:48 2007 +0000
+++ b/configure.in	Fri Aug 24 20:26:24 2007 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.571 $)
+AC_REVISION($Revision: 1.572 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1433,10 +1433,10 @@
   lstat memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise \
   readlink realpath rename resolvepath rindex rmdir round select setgrent \
   setlocale setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \
-  sigsuspend stat strcasecmp strdup strerror stricmp \
+  sigsuspend snprintf stat strcasecmp strdup strerror stricmp \
   strncasecmp strnicmp strsignal symlink tempnam umask \
   uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid \
-  _chmod _utime _utime32)
+  _chmod _snprintf x_utime _utime32)
 
 case "$canonical_host_type" in
   *-*-msdosmsvc)
@@ -2056,6 +2056,7 @@
   HDF5 libraries:       $HDF5_LIBS
   CURL libraries:       $CURL_LIBS
   REGEX libraries:      $REGEX_LIBS
+  QHULL libraries:	$QHULL_LIBS
   LIBS:                 $LIBS
   Default pager:        $DEFAULT_PAGER
   gnuplot:              $GNUPLOT_BINARY
@@ -2190,6 +2191,11 @@
   warn_msg_printed=true
 fi
 
+if test -n "$warn_qhull"; then
+  AC_MSG_WARN($warn_qhull)
+  warn_msg_printed=true
+fi
+
 if test -n "$warn_zlib"; then
   AC_MSG_WARN($warn_zlib)
   warn_msg_printed=true
--- a/scripts/ChangeLog	Fri Aug 24 16:59:48 2007 +0000
+++ b/scripts/ChangeLog	Fri Aug 24 20:26:24 2007 +0000
@@ -1,3 +1,7 @@
+2007-08-24  David Bateman  <dbateman@free.fr>
+
+	* plot/__go_draw_axes__.m: Treat text color property.
+
 2007-08-24  John W. Eaton  <jwe@octave.org>
 
 	* plot/subplot.m, plot/plot.m, plot/grid.m:
--- a/scripts/plot/__go_draw_axes__.m	Fri Aug 24 16:59:48 2007 +0000
+++ b/scripts/plot/__go_draw_axes__.m	Fri Aug 24 20:26:24 2007 +0000
@@ -599,22 +599,51 @@
 	  halign = obj.horizontalalignment;
 	  angle = obj.rotation;
           units = obj.units;
+	  color = obj.color;
           if (strcmpi (units, "normalized"))
             units = "graph";
           else
             units = "";
           endif
 	  
+	  if (isnumeric (color))
+	    if (have_newer_gnuplot)
+	      colorspec = sprintf ("textcolor rgb \"#%02x%02x%02x\"",
+		       round (255*color));
+	    else
+	      if (isequal (color, [0,0,0]))
+		typ = -1;
+	      elseif (isequal (color, [1,0,0]))
+		typ = 1;
+	      elseif (isequal (color, [0,1,0]))
+		typ = 2;
+	      elseif (isequal (color, [0,0,1]))
+		typ = 3;
+	      elseif (isequal (color, [1,0,1]))
+		typ = 4;
+	      elseif (isequal (color, [0,1,1]))
+		typ = 5;
+	      elseif (isequal (color, [1,1,1]))
+		typ = -1;
+	      elseif (isequal (color, [1,1,0]))
+		typ = 7;
+	      else
+		typ = -1;
+	      endif
+	      colorspec = sprintf ("textcolor lt %d", typ);
+	    endif
+	  endif
+
 	  if (nd == 3)
 	    fprintf (plot_stream,
-		     "set label \"%s\" at %s %g,%g,%g %s rotate by %f;\n",
+		     "set label \"%s\" at %s %g,%g,%g %s rotate by %f %s;\n",
 		     undo_string_escapes (label), units,
-		     lpos(1), lpos(2), lpos(3), halign, angle);
+		     lpos(1), lpos(2), lpos(3), halign, angle, colorspec);
 	  else
 	    fprintf (plot_stream,
-		     "set label \"%s\" at %s %g,%g %s rotate by %f;\n",
+		     "set label \"%s\" at %s %g,%g %s rotate by %f %s;\n",
 		     undo_string_escapes (label), units,
-		     lpos(1), lpos(2), halign, angle);
+		     lpos(1), lpos(2), halign, angle, colorspec);
 	  endif
 
 	otherwise
--- a/src/ChangeLog	Fri Aug 24 16:59:48 2007 +0000
+++ b/src/ChangeLog	Fri Aug 24 20:26:24 2007 +0000
@@ -1,3 +1,19 @@
+2007-08-24  David Bateman  <dbateman@free.fr>
+
+	* symtab.cc (void symbol_table::clear (void)): If the record in
+	the symbol table to clear is a user function that is a sub
+	function with a static parent or if the parent is the current
+	parent function, don't delete the record.
+	(void symbol_table::clear_functions (void)): ditto.
+	(void symbol_table::clear (const std::string&)): ditto.
+	(void symbol_table::clear_function (const std::string&)): ditto.
+
+	* graphics.h (class text): Add property color.
+	* graphics.cc (text::text_properties::text_properties) ditto.
+	(text::text_properties::set): ditto.
+	(text::text_properties::get): ditto.
+	(text::text_properties::factory_defaults): ditto.
+
 2007-08-24  John W. Eaton  <jwe@octave.org>
 
 	* mappers.cc (octave_is_NA (int), xisnan (int)): New functions.
--- a/src/graphics.cc	Fri Aug 24 16:59:48 2007 +0000
+++ b/src/graphics.cc	Fri Aug 24 20:26:24 2007 +0000
@@ -1800,7 +1800,8 @@
     units ("data"),
     position (Matrix (1, 3, 0.0)),
     rotation (0),
-    horizontalalignment ("left")
+    horizontalalignment ("left"),
+    color (Matrix (1, 3, 1.0))
 { }
 
 void
@@ -1827,6 +1828,8 @@
     rotation = val;
   else if (name.compare ("horizontalalignment"))
     horizontalalignment = val;
+  else if (name.compare ("color"))
+    color = val;
   else
     {
       modified = false;
@@ -1851,6 +1854,7 @@
   m.assign ("position", position);
   m.assign ("rotation", rotation);
   m.assign ("horizontalalignment", horizontalalignment);
+  m.assign ("color", color);
 
   return m;
 }
@@ -1878,6 +1882,8 @@
     retval = rotation;
   else if (name.compare ("horizontalalignment"))
     retval = horizontalalignment;
+  else if (name.compare ("color"))
+    retval = color;
   else
     warning ("get: invalid property `%s'", name.c_str ());
 
@@ -1894,6 +1900,7 @@
   m["position"] = Matrix (1, 3, 0.0);
   m["rotation"] = 0;
   m["horizontalalignment"] = "left";
+  m["color"] = Matrix (1, 3, 1.0);
 
   return m;
 }
--- a/src/graphics.h	Fri Aug 24 16:59:48 2007 +0000
+++ b/src/graphics.h	Fri Aug 24 20:26:24 2007 +0000
@@ -1446,6 +1446,7 @@
     octave_value position;
     octave_value rotation;
     octave_value horizontalalignment;
+    octave_value color;
 
     static std::string go_name;
   };
--- a/src/symtab.cc	Fri Aug 24 16:59:48 2007 +0000
+++ b/src/symtab.cc	Fri Aug 24 20:26:24 2007 +0000
@@ -45,6 +45,8 @@
 #include "symtab.h"
 #include "utils.h"
 #include "variables.h"
+#include "ov-usr-fcn.h"
+#include "toplev.h"
 
 #include "gripes.h"
 #include "lo-mappers.h"
@@ -794,6 +796,32 @@
 
       while (ptr)
 	{
+	  if (ptr->is_user_function())
+	    {
+	      octave_user_function *fcn = ptr->def ().user_function_value ();
+	      std::string parent = (fcn ? fcn->parent_fcn_name () :
+				    std::string ());
+
+	      if (! parent.empty ())
+		{
+		  if (curr_parent_function &&
+		      parent == curr_parent_function->name ())
+		    {
+		      ptr = ptr->next ();
+		      continue;
+		    }			  
+
+		  symbol_record *parent_sr = fbi_sym_tab->lookup (parent);
+
+		  if (parent_sr && (parent_sr->is_static () ||
+				    parent_sr->is_eternal ()))
+		  {
+		    ptr = ptr->next ();
+		    continue;
+		  }
+		}
+	    }
+
 	  ptr->clear ();
 
 	  ptr = ptr->next ();
@@ -832,7 +860,37 @@
 	  if (ptr->is_user_function ()
 	      || ptr->is_dld_function ()
 	      || ptr->is_mex_function ())
-	    ptr->clear ();
+	    {
+
+	      if (ptr->is_user_function())
+		{
+		  octave_user_function *fcn = 
+		    ptr->def ().user_function_value ();
+		  std::string parent = (fcn ? fcn->parent_fcn_name () :
+					std::string ());
+
+		  if (! parent.empty ())
+		    {
+		      if (curr_parent_function &&
+			  parent == curr_parent_function->name ())
+			{
+			  ptr = ptr->next ();
+			  continue;
+			}			  
+
+		      symbol_record *parent_sr = fbi_sym_tab->lookup (parent);
+
+		      if (parent_sr && (parent_sr->is_static () ||
+					parent_sr->is_eternal ()))
+			{
+			  ptr = ptr->next ();
+			  continue;
+			}
+		    }
+		}
+
+	      ptr->clear ();
+	    }
 
 	  ptr = ptr->next ();
 	}
@@ -884,6 +942,27 @@
     {
       if (ptr->name () == nm)
 	{
+	  if (ptr->is_user_function())
+	    {
+	      octave_user_function *fcn = 
+		ptr->def ().user_function_value ();
+	      std::string parent = (fcn ? fcn->parent_fcn_name () :
+				    std::string ());
+
+	      if (! parent.empty ())
+		{
+		  if (curr_parent_function &&
+		      parent == curr_parent_function->name ())
+		    return true;
+
+		  symbol_record *parent_sr = fbi_sym_tab->lookup (parent);
+		  
+		  if (parent_sr && (parent_sr->is_static () ||
+				    parent_sr->is_eternal ()))
+		    return true;
+		}
+	    }
+
 	  ptr->clear ();
 
 	  return true;
@@ -952,6 +1031,27 @@
 	      || ptr->is_dld_function ()
 	      || ptr->is_mex_function ()))
 	{
+	  if (ptr->is_user_function())
+	    {
+	      octave_user_function *fcn = 
+		ptr->def ().user_function_value ();
+	      std::string parent = (fcn ? fcn->parent_fcn_name () :
+				    std::string ());
+
+	      if (! parent.empty ())
+		{
+		  if (curr_parent_function &&
+		      parent == curr_parent_function->name ())
+		    return true;
+
+		  symbol_record *parent_sr = fbi_sym_tab->lookup (parent);
+		  
+		  if (parent_sr && (parent_sr->is_static () ||
+				    parent_sr->is_eternal ()))
+		    return true;
+		}
+	    }
+
 	  ptr->clear ();
 	  return true;
 	}