[GRASS-SVN] r56501 - grass/branches/develbranch_6/misc/m.nviz.image

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 29 22:59:51 PDT 2013


Author: hamish
Date: 2013-05-29 22:59:51 -0700 (Wed, 29 May 2013)
New Revision: 56501

Modified:
   grass/branches/develbranch_6/misc/m.nviz.image/args.c
   grass/branches/develbranch_6/misc/m.nviz.image/local_proto.h
   grass/branches/develbranch_6/misc/m.nviz.image/vector.c
Log:
add a vpoint_mode option to respect 3D map points placement

Modified: grass/branches/develbranch_6/misc/m.nviz.image/args.c
===================================================================
--- grass/branches/develbranch_6/misc/m.nviz.image/args.c	2013-05-29 22:20:25 UTC (rev 56500)
+++ grass/branches/develbranch_6/misc/m.nviz.image/args.c	2013-05-30 05:59:51 UTC (rev 56501)
@@ -339,6 +339,8 @@
     params->vline_mode->multiple = YES;
     params->vline_mode->description = _("Vector line display mode");
     params->vline_mode->options = "surface,flat";
+    params->vline_mode->descriptions = _("surface;drape on raster surface;"
+					 "flat;draw at constant elevation");
     params->vline_mode->answer = "surface";
     params->vline_mode->guisection = _("Vector lines");
 
@@ -411,6 +413,21 @@
     params->vpoint_color->guisection = _("Vector points");
 
     /* point mode */
+    params->vpoint_mode = G_define_option();
+    params->vpoint_mode->key = "vpoint_mode";
+    params->vpoint_mode->key_desc = "string";
+    params->vpoint_mode->type = TYPE_STRING;
+    params->vpoint_mode->required = NO;
+    params->vpoint_mode->multiple = YES;
+    params->vpoint_mode->description = _("Vector point display mode");
+    params->vpoint_mode->options = "surface,3D";
+    params->vpoint_mode->descriptions = _("surface;drape on raster surface;"
+					  "3D;place at 3D point's z-elevation");
+					  /* TODO: "flat", place at a constant elevation */
+    params->vpoint_mode->answer = "surface";
+    params->vpoint_mode->guisection = _("Vector points");
+
+    /* point icon type */
     params->vpoint_marker = G_define_option();
     params->vpoint_marker->key = "vpoint_marker";
     params->vpoint_marker->key_desc = "string";

Modified: grass/branches/develbranch_6/misc/m.nviz.image/local_proto.h
===================================================================
--- grass/branches/develbranch_6/misc/m.nviz.image/local_proto.h	2013-05-29 22:20:25 UTC (rev 56500)
+++ grass/branches/develbranch_6/misc/m.nviz.image/local_proto.h	2013-05-30 05:59:51 UTC (rev 56501)
@@ -18,7 +18,8 @@
     /* vector lines */
 	*vlines, *vline_width, *vline_color, *vline_mode, *vline_height, *vline_pos,
     /* vector points */
-	*vpoints, *vpoint_size, *vpoint_marker, *vpoint_color, *vpoint_width, *vpoint_pos,
+	*vpoints, *vpoint_size, *vpoint_mode, *vpoint_marker, *vpoint_color,
+	*vpoint_width, *vpoint_pos,
     /* volumes */
 	*volume, *volume_mode, *volume_shade, *volume_pos, *volume_res, *isosurf_level,
 	*isosurf_color_map, *isosurf_color_const, *isosurf_transp_map, *isosurf_transp_const,

Modified: grass/branches/develbranch_6/misc/m.nviz.image/vector.c
===================================================================
--- grass/branches/develbranch_6/misc/m.nviz.image/vector.c	2013-05-29 22:20:25 UTC (rev 56500)
+++ grass/branches/develbranch_6/misc/m.nviz.image/vector.c	2013-05-30 05:59:51 UTC (rev 56501)
@@ -159,6 +159,12 @@
 	width = atoi(params->vpoint_width->answers[i]);
 	marker_str = params->vpoint_marker->answers[i];
 
+	if (strcmp(params->vpoint_mode->answers[i], "3D") == 0)
+	    GP_set_zmode(site_list[i], 1);  /* respect z-value of 3D points */
+					    /* if you pass this a 2D map it drapes on DEM */
+	else
+	    GP_set_zmode(site_list[i], 0);  /* drape points on raster surface */
+
 	if (strcmp(marker_str, "x") == 0)
 	    marker = ST_X;
 	else if (strcmp(marker_str, "sphere") == 0)



More information about the grass-commit mailing list