[GRASS-SVN] r59056 - grass/trunk/display/d.vect

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 15 08:48:17 PST 2014


Author: martinl
Date: 2014-02-15 08:48:17 -0800 (Sat, 15 Feb 2014)
New Revision: 59056

Modified:
   grass/trunk/display/d.vect/d.vect.html
   grass/trunk/display/d.vect/local_proto.h
   grass/trunk/display/d.vect/main.c
   grass/trunk/display/d.vect/shape.c
Log:
d.vect: simplify usage (zcolor), -z flag removed


Modified: grass/trunk/display/d.vect/d.vect.html
===================================================================
--- grass/trunk/display/d.vect/d.vect.html	2014-02-15 16:26:21 UTC (rev 59055)
+++ grass/trunk/display/d.vect/d.vect.html	2014-02-15 16:48:17 UTC (rev 59056)
@@ -85,16 +85,16 @@
 # display as black points
 d.vect map=random3d
 # display 3D points colorized according to z height
-d.vect -z map=random3d zcolor=gyr
+d.vect map=random3d zcolor=gyr
 
 # 3D contour lines
 r.contour input=elevation.10m output=contour20m step=20
-d.vect -z map=contour20m zcolor=gyr
+d.vect map=contour20m zcolor=gyr
 
 # generate 3D triangles
 v.delaunay input=random3d output=random3d_del
 # display 3D polygons colorized according to z height
-d.vect -z map=random3d_del type=area zcolor=gyr
+d.vect map=random3d_del type=area zcolor=gyr
 </pre></div>
 
 <h2>SEE ALSO</h2>

Modified: grass/trunk/display/d.vect/local_proto.h
===================================================================
--- grass/trunk/display/d.vect/local_proto.h	2014-02-15 16:26:21 UTC (rev 59055)
+++ grass/trunk/display/d.vect/local_proto.h	2014-02-15 16:48:17 UTC (rev 59056)
@@ -40,7 +40,7 @@
 		  const char *, double, const char *, int, const char *, /* lines only */
 		  int, int, char *,
 		  int, char *, double,
-		  int, char *);
+		  char *);
 int get_table_color(int, int, struct Colors *, dbCatValArray *,
 		    int *, int *, int *);
 int get_cat_color(int, const struct line_cats *, const struct cat_list *,

Modified: grass/trunk/display/d.vect/main.c
===================================================================
--- grass/trunk/display/d.vect/main.c	2014-02-15 16:26:21 UTC (rev 59055)
+++ grass/trunk/display/d.vect/main.c	2014-02-15 16:48:17 UTC (rev 59056)
@@ -52,8 +52,7 @@
     struct Option *lsize_opt, *font_opt, *enc_opt, *xref_opt, *yref_opt;
     struct Option *attrcol_opt, *maxreg_opt, *minreg_opt;
     struct Option *width_opt, *wcolumn_opt, *wscale_opt;
-    struct Flag *id_flag, *cats_acolors_flag,
-	*zcol_flag, *sqrt_flag;
+    struct Flag *id_flag, *cats_acolors_flag, *sqrt_flag;
     char *desc;
     
     struct cat_list *Clist;
@@ -141,8 +140,7 @@
     
     zcol_opt = G_define_standard_option(G_OPT_M_COLR);
     zcol_opt->key = "zcolor";
-    zcol_opt->description = _("Name of color table (for use with -z flag)");
-    zcol_opt->answer = "terrain";
+    zcol_opt->description = _("Colorize features according to z-coordinate");
     zcol_opt->guisection = _("Colors");
 
     /* Lines */
@@ -309,11 +307,6 @@
     id_flag->guisection = _("Selection");
     id_flag->description = _("Use values from 'cats' option as feature id");
 
-    zcol_flag = G_define_flag();
-    zcol_flag->key = 'z';
-    zcol_flag->description = _("Colorize features according to z-coordinate (only for 3D vector maps)");
-    zcol_flag->guisection = _("Colors");
-
     sqrt_flag = G_define_flag();
     sqrt_flag->key = 'r';
     sqrt_flag->label = _("Use square root of the value of size_column");
@@ -441,7 +434,7 @@
 				  id_flag->answer ? TRUE : FALSE, 
 				  cats_acolors_flag->answer ? TRUE : FALSE, rgbcol_opt->answer,
 				  default_width,  wcolumn_opt->answer, width_scale,
-				  zcol_flag->answer ? TRUE : FALSE, zcol_opt->answer);
+				  zcol_opt->answer);
 	    
 	    if (wcolumn_opt->answer)
 		D_line_width(default_width);

Modified: grass/trunk/display/d.vect/shape.c
===================================================================
--- grass/trunk/display/d.vect/shape.c	2014-02-15 16:26:21 UTC (rev 59055)
+++ grass/trunk/display/d.vect/shape.c	2014-02-15 16:48:17 UTC (rev 59056)
@@ -24,7 +24,7 @@
 		  const char *icon, double size, const char *size_column, int sqrt_flag, const char *rot_column, /* lines only */
 		  int id_flag, int cats_colors_flag, char *rgb_column,
 		  int default_width, char *width_column, double width_scale,
-		  int z_color_flag, char *z_style)
+		  char *z_style)
 {
     int open_db, field, i, stat;
     dbCatValArray cvarr_rgb, cvarr_width, cvarr_size, cvarr_rot;
@@ -184,10 +184,10 @@
 	db_close_database_shutdown_driver(driver);
     }
 
-    if (z_color_flag) {
+    if (z_style) {
 	if (!Vect_is_3d(Map)) {
 	    G_warning(_("Vector map is not 3D. Unable to colorize features based on z-coordinates."));
-	    z_color_flag = 0;
+	    z_style = NULL;
 	}
 	else {
 	    Vect_get_map_box(Map, &box);
@@ -201,7 +201,7 @@
 			     bcolor, fcolor, chcat,
 			     id_flag, cats_colors_flag,
 			     default_width, width_scale,
-			     z_color_flag ? &zcolors : NULL,
+			     z_style ? &zcolors : NULL,
 			     rgb_column ? &cvarr_rgb : NULL,
 			     have_colors ? &colors : NULL,
 			     &cvarr_width, nrec_width);
@@ -211,7 +211,7 @@
 			  icon, size, sqrt_flag,
 			  id_flag, cats_colors_flag,
 			  default_width, width_scale,
-			  z_color_flag ? &zcolors : NULL,
+			  z_style ? &zcolors : NULL,
 			  rgb_column ? &cvarr_rgb : NULL,
 			  have_colors ? &colors : NULL,
 			  &cvarr_width, nrec_width,



More information about the grass-commit mailing list