On Tue, Aug 18, 2009 at 4:45 PM, Hezekiah M.
Carty<hezekiahca...@users.sourceforge.net> wrote:
> Is it worth adding a PLplot cmake/compile-time option to change the
> default color map 0 to this or some other alternate?  This would allow
> someone who wants white backgrounds to be the rule rather than the
> exception to avoid having to set the palette for each plot.

I have attached an initial patch which adds cmake configuration
support for enabling the alternate cmap0 by default.  One can pass
"-DPL_ALT_CMAP0=ON" to cmake to use to alternate color map 0 colors by
default.  If PL_ALT_CMAP0 is set to OFF or is left unset (it defaults
to OFF), the current default (black background) color map 0 palette is
used.

If this compile-time palette support is added to PLplot, I would
appreciate a review of this patch, particularly the CMake pieces.  I
think I am setting things up correctly, but I'm not sure if everything
is in the proper location.

Enjoy,

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science
diff --git a/include/plConfig.h.cmake b/include/plConfig.h.cmake
index 8bc0252..b90723d 100644
--- a/include/plConfig.h.cmake
+++ b/include/plConfig.h.cmake
@@ -75,4 +75,7 @@
  * - broken Mac OSX systems */
 #cmakedefine PL_BROKEN_ISNAN_CXX
 
+/* Define if you want to use the alternate cmap0 */
+#cmakedefine PL_ALT_CMAP0
+
 #endif	/* __PLCONFIG_H__ */
diff --git a/src/plctrl.c b/src/plctrl.c
index 4428ed8..ae51a59 100644
--- a/src/plctrl.c
+++ b/src/plctrl.c
@@ -898,6 +898,7 @@ plcmap0_def(int imin, int imax)
 {
     int i;
 
+#ifndef PL_ALT_CMAP0
     color_def(0,    0,   0,   0, 1.0, "black" );        /* black */
     color_def(1,  255,   0,   0, 1.0, "red");           /* red */
     color_def(2,  255, 255,   0, 1.0, "yellow" );       /* yellow */
@@ -914,23 +915,24 @@ plcmap0_def(int imin, int imax)
     color_def(13, 255,   0, 255, 1.0, "magenta" );	/* magenta */
     color_def(14, 250, 128, 114, 1.0, "salmon" );	/* salmon */
     color_def(15, 255, 255, 255, 1.0, "white" );	/* white */
-
-/*     color_def(0, 255, 255, 255, "white" );	/\* white *\/ */
-/*     color_def(1,    0,   0,   0, "black" );	/\* black *\/ */
-/*     color_def(2,    0,   0, 255, "blue" );	/\* blue *\/ */
-/*     color_def(3,  255,   0,   0, "red");	/\* red *\/ */
-/*     color_def(4,  165,  42,  42, "brown" );	/\* brown *\/ */
-/*     color_def(5, 250, 128, 114, "salmon" );	/\* salmon *\/ */
-/*     color_def(6,  255, 192, 203, "pink" );	/\* pink *\/ */
-/*     color_def(7,  127, 255, 212, "aquamarine" );	/\* aquamarine *\/ */
-/*     color_def(8,  245, 222, 179, "wheat" );	/\* wheat *\/ */
-/*     color_def(9,  64, 224, 208, "turquoise" );	/\* turquoise *\/ */
-/*     color_def(10,  190, 190, 190, "grey" );	/\* grey *\/ */
-/*     color_def(11,   0, 255, 255, "cyan" );	/\* cyan *\/ */
-/*     color_def(12,    0, 255,   0, "green" );	/\* green *\/ */
-/*     color_def(13,  255, 255,   0, "yellow" );	/\* yellow *\/ */
-/*     color_def(14, 255,   0, 255, "magenta" );	/\* magenta *\/ */
-/*     color_def(15, 138,  43, 226, "BlueViolet" );	/\* Blue Violet *\/ */
+#else
+    color_def(0,  255, 255, 255, 1.0, "white" );	/* white */
+    color_def(1,    0,   0,   0, 1.0, "black" );	/* black */
+    color_def(2,    0,   0, 255, 1.0, "blue" );	        /* blue */
+    color_def(3,  255,   0,   0, 1.0, "red");	        /* red */
+    color_def(4,  165,  42,  42, 1.0, "brown" );	/* brown */
+    color_def(5,  250, 128, 114, 1.0, "salmon" );	/* salmon */
+    color_def(6,  255, 192, 203, 1.0, "pink" );	        /* pink */
+    color_def(7,  127, 255, 212, 1.0, "aquamarine" );   /* aquamarine */
+    color_def(8,  245, 222, 179, 1.0, "wheat" );	/* wheat */
+    color_def(9,   64, 224, 208, 1.0, "turquoise" );	/* turquoise */
+    color_def(10, 190, 190, 190, 1.0, "grey" );         /* grey */
+    color_def(11,   0, 255, 255, 1.0, "cyan" );	        /* cyan */
+    color_def(12,   0, 255,   0, 1.0, "green" );	/* green */
+    color_def(13, 255, 255,   0, 1.0, "yellow" );	/* yellow */
+    color_def(14, 255,   0, 255, 1.0, "magenta" );	/* magenta */
+    color_def(15, 138,  43, 226, 1.0, "BlueViolet" );	/* Blue Violet */
+#endif
 
 /* Any others are just arbitrarily set */
 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to