Browse Source

clarify vlines style usage, add debug messages (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32538 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 17 years ago
parent
commit
372eeb56bf
3 changed files with 11 additions and 6 deletions
  1. 6 5
      ps/ps.map/description.html
  2. 3 0
      ps/ps.map/do_vectors.c
  3. 2 1
      ps/ps.map/r_vlines.c

+ 6 - 5
ps/ps.map/description.html

@@ -1307,7 +1307,7 @@ USAGE:	<B>vlines</B> vectormap
 	<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 @@ for more information on the mask);
 <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>

+ 3 - 0
ps/ps.map/do_vectors.c

@@ -67,6 +67,7 @@ int do_vectors(int after_masking)
 	    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 @@ int do_vectors(int after_masking)
 	    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);
 	}
 

+ 2 - 1
ps/ps.map/r_vlines.c

@@ -24,7 +24,7 @@ static char *help[] = {
     "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 @@ int read_vlines(char *name, char *mapset)
 	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;
 	    }