[GRASS-SVN] r38646 - in grass/trunk: display/d.grid display/d.vect include lib/symbol

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 9 03:59:51 EDT 2009


Author: hamish
Date: 2009-08-09 03:59:50 -0400 (Sun, 09 Aug 2009)
New Revision: 38646

Modified:
   grass/trunk/display/d.grid/fiducial.c
   grass/trunk/display/d.vect/plot1.c
   grass/trunk/include/symbol.h
   grass/trunk/lib/symbol/stroke.c
Log:
S_stroke() size int -> double

Modified: grass/trunk/display/d.grid/fiducial.c
===================================================================
--- grass/trunk/display/d.grid/fiducial.c	2009-08-08 18:50:46 UTC (rev 38645)
+++ grass/trunk/display/d.grid/fiducial.c	2009-08-09 07:59:50 UTC (rev 38646)
@@ -26,7 +26,7 @@
     SYMBOL *Symb;
     RGBA_Color *line_color, *fill_color;
     int R, G, B;
-    int size = 16;
+    double size = 16.0;
     int tolerance = 0;
 
     line_color = G_malloc(sizeof(RGBA_Color));

Modified: grass/trunk/display/d.vect/plot1.c
===================================================================
--- grass/trunk/display/d.vect/plot1.c	2009-08-08 18:50:46 UTC (rev 38645)
+++ grass/trunk/display/d.vect/plot1.c	2009-08-09 07:59:50 UTC (rev 38646)
@@ -202,11 +202,11 @@
 	G_debug(2, " %d records selected from table", nrec_size);
 
 	for (i = 0; i < cvarr_size.n_values; i++) {
-	    G_debug(4, "(size) cat = %d  %s = %d", cvarr_size.value[i].cat,
+	    G_debug(4, "(size) cat = %d  %s = %.2f", cvarr_size.value[i].cat,
 		    size_column,
 		    (cvarr_size.ctype ==
-		     DB_C_TYPE_INT ? cvarr_size.value[i].val.
-		     i : (int)cvarr_size.value[i].val.d));
+		     DB_C_TYPE_INT ? (double)cvarr_size.value[i].val.i
+		     : cvarr_size.value[i].val.d));
 	}
     }
 
@@ -233,11 +233,11 @@
 	G_debug(2, " %d records selected from table", nrec_rot);
 
 	for (i = 0; i < cvarr_rot.n_values; i++) {
-	    G_debug(4, "(rot) cat = %d  %s = %d", cvarr_rot.value[i].cat,
+	    G_debug(4, "(rot) cat = %d  %s = %.2f", cvarr_rot.value[i].cat,
 		    rot_column,
 		    (cvarr_rot.ctype ==
-		     DB_C_TYPE_INT ? cvarr_rot.value[i].val.
-		     i : (int)cvarr_rot.value[i].val.d));
+		     DB_C_TYPE_INT ? (double)cvarr_rot.value[i].val.i
+		     : cvarr_rot.value[i].val.d));
 	}
     }
 
@@ -246,7 +246,7 @@
 	if (Symb == NULL)
 	    G_warning(_("Unable to read symbol, unable to display points"));
 	else
-	    S_stroke(Symb, size, 0.0, 0);
+	    S_stroke(Symb, (double)size, 0.0, 0);
     }
 
     if (open_db)
@@ -440,8 +440,8 @@
 		else {
 		    width =
 			width_scale * (cvarr_width.ctype ==
-				       DB_C_TYPE_INT ? cv_width->val.
-				       i : (int)cv_width->val.d);
+				       DB_C_TYPE_INT ? cv_width->val.i
+				       : (int)cv_width->val.d);
 		    if (width < 0) {
 			G_warning(_("Error in line width column (%s), element %d "
 				   "with cat %d: line width [%d]"),
@@ -537,8 +537,8 @@
 	    }		/* end if nrec_rot */
 
 	    if(nrec_size || nrec_rot) {
-		G_debug(3, ". dynamic symbol: cat=%d  size=%d  rotation=%.2f",
-			cat, (int)(var_size + 0.5), rotation);
+		G_debug(3, ". dynamic symbol: cat=%d  size=%.2f  rotation=%.2f",
+			cat, var_size, rotation);
 
 		/* symbol stroking is cumulative, so we need to reread it each time */
 		if(Symb) /* unclean free() on first iteration if variables are not init'd to NULL? */
@@ -547,7 +547,7 @@
 		if (Symb == NULL)
 		    G_warning(_("Unable to read symbol, unable to display points"));
 		else
-		    S_stroke(Symb, (int)(var_size + 0.5), rotation, 0);
+		    S_stroke(Symb, var_size, rotation, 0);
 	    }
 
 	    /* use random or RGB column color if given, otherwise reset */

Modified: grass/trunk/include/symbol.h
===================================================================
--- grass/trunk/include/symbol.h	2009-08-08 18:50:46 UTC (rev 38645)
+++ grass/trunk/include/symbol.h	2009-08-09 07:59:50 UTC (rev 38646)
@@ -73,6 +73,6 @@
 
 /* prototypes */
 SYMBOL *S_read(char *sname);
-void S_stroke(SYMBOL * symb, int size, double rotation, int tolerance);
+void S_stroke(SYMBOL * symb, double size, double rotation, int tolerance);
 
 #endif

Modified: grass/trunk/lib/symbol/stroke.c
===================================================================
--- grass/trunk/lib/symbol/stroke.c	2009-08-08 18:50:46 UTC (rev 38645)
+++ grass/trunk/lib/symbol/stroke.c	2009-08-09 07:59:50 UTC (rev 38646)
@@ -139,19 +139,25 @@
     return 0;
 }
 
-/* 
- *  Stroke symbol to form used for Xdriver.
+/*!
+ * \brief Stroke symbol to form used for Xdriver.
  *
  *  tolerance currently not supported
+ *
+ * \param Symb  pointer to 
+ * \param size  symbol size
+ * \param rotation  symbol rotation, degrees CCW from East
+ * \param tolerance  currently not supported
+ *
  */
-void S_stroke(SYMBOL *Symb, int size, double rotation, int tolerance)
+void S_stroke(SYMBOL *Symb, double size, double rotation, int tolerance)
 {
     int i, j;
     double s;
     SYMBPART *part;
 
-    G_debug(3, "S_stroke(): size = %d rotation = %f tolerance = %d", size,
-	    rotation, tolerance);
+    G_debug(3, "S_stroke(): size = %.2f, rotation = %.2f, tolerance = %d",
+	    size, rotation, tolerance);
 
     /* TODO: support for tolerance */
 



More information about the grass-commit mailing list