[GRASS-SVN] r32538 - grass/trunk/ps/ps.map

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 5 04:11:04 EDT 2008


Author: hamish
Date: 2008-08-05 04:11:04 -0400 (Tue, 05 Aug 2008)
New Revision: 32538

Modified:
   grass/trunk/ps/ps.map/description.html
   grass/trunk/ps/ps.map/do_vectors.c
   grass/trunk/ps/ps.map/r_vlines.c
Log:
clarify vlines style usage, add debug messages (merge from devbr6)

Modified: grass/trunk/ps/ps.map/description.html
===================================================================
--- grass/trunk/ps/ps.map/description.html	2008-08-05 07:54:31 UTC (rev 32537)
+++ grass/trunk/ps/ps.map/description.html	2008-08-05 08:11:04 UTC (rev 32538)
@@ -1307,7 +1307,7 @@
 	<B>offset</B> #
 	<B>coffset</B> #
 	<B>ref</B> left|right
-	<B>style</B>  0-9
+	<B>style</B> 00001111
 	<B>label</B> label
 	<B>lpos</B> #
 	<B>end</B>
@@ -1349,10 +1349,11 @@
 <B>style</B> - the line style allows the vectors
 to be dashed in different patterns.  This is done by typing a
 series of numbers (0's and 1's) in a desired sequence or pattern.
-Blanks and
-non-digit characters are recognized as 0's. Using 0 would allow the
-colors of the raster map layer (or the background color
-if no raster map layer was selected) to show through;
+The first block of repeated zeros or ones represents "draw", the second
+block represents "blank".
+An even number of blocks will repeat the pattern, an odd number of blocks
+will alternate the pattern.
+The default is "solid";
 <P>
 <B>cats</B> - which categories should be plotted (default is all);
 <P>

Modified: grass/trunk/ps/ps.map/do_vectors.c
===================================================================
--- grass/trunk/ps/ps.map/do_vectors.c	2008-08-05 07:54:31 UTC (rev 32537)
+++ grass/trunk/ps/ps.map/do_vectors.c	2008-08-05 08:11:04 UTC (rev 32538)
@@ -67,6 +67,7 @@
 	    dashes[1] = 0;
 	    lz = 0;
 	    if (vector.layer[n].linestyle != NULL) {
+		G_debug(1, "Line style: '%s'", vector.layer[n].linestyle);
 		G_strip(vector.layer[n].linestyle);
 		ptr = vector.layer[n].linestyle;
 		while (*ptr && (*ptr < '1' || *ptr > '9')) {
@@ -102,6 +103,8 @@
 	    strcat(dashes, buf);
 	    fprintf(PS.fp, "%s setdash\n", dashes);
 	    vector.layer[n].setdash = G_store(dashes);
+	    if (vector.layer[n].linestyle != NULL)
+		G_debug(1, "Dash style: '%s setdash'", dashes);
 	    PS_vlines_plot(&Map, n, LINE_DRAW_LINE);
 	}
 

Modified: grass/trunk/ps/ps.map/r_vlines.c
===================================================================
--- grass/trunk/ps/ps.map/r_vlines.c	2008-08-05 07:54:31 UTC (rev 32537)
+++ grass/trunk/ps/ps.map/r_vlines.c	2008-08-05 08:11:04 UTC (rev 32538)
@@ -24,7 +24,7 @@
     "offset      #",
     "coffset     #",
     "masked      [y|n]",
-    "style       solid|[0-9]...",
+    "style       solid|[0|1]...",
     "line_cat    #",
     "acolor      r g b",
     "label       label",
@@ -132,6 +132,7 @@
 	if (KEY("style")) {
 	    G_strip(data);
 	    if (strcmp(data, "solid") == 0) {
+/* TODO: add "dotted" and "dashed" preset line patterns */
 		vector.layer[vec].linestyle = NULL;
 		continue;
 	    }



More information about the grass-commit mailing list