[GRASS-SVN] r39094 - grass/branches/develbranch_6/vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 9 11:44:53 EDT 2009


Author: martinl
Date: 2009-09-09 11:44:53 -0400 (Wed, 09 Sep 2009)
New Revision: 39094

Modified:
   grass/branches/develbranch_6/vector/v.edit/args.c
   grass/branches/develbranch_6/vector/v.edit/main.c
Log:
v.edit: enable 3D for 'move' (thanks to Harri Kiiskinen for the patch)
	(merge r39093 from trunk)


Modified: grass/branches/develbranch_6/vector/v.edit/args.c
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/args.c	2009-09-09 15:39:35 UTC (rev 39093)
+++ grass/branches/develbranch_6/vector/v.edit/args.c	2009-09-09 15:44:53 UTC (rev 39094)
@@ -15,7 +15,7 @@
  *             Read the file COPYING that comes with GRASS
  *             for details.
  *
- * TODO:       3D support
+ * TODO:       3D support (done for move and vertexmove)
  ****************************************************************/
 
 #include "global.h"
@@ -104,12 +104,12 @@
 
     params->move = G_define_option();
     params->move->key = "move";
-    params->move->key_desc = "x,y";
+    params->move->key_desc = "x,y,z";
     params->move->type = TYPE_DOUBLE;
     params->move->required = NO;
     params->move->multiple = NO;
     params->move->description =
-	_("Difference in x,y direction for moving feature or vertex");
+	_("Difference in x,y,z direction for moving feature or vertex");
 
     params->maxdist = G_define_option();
     params->maxdist->key = "thresh";

Modified: grass/branches/develbranch_6/vector/v.edit/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/main.c	2009-09-09 15:39:35 UTC (rev 39093)
+++ grass/branches/develbranch_6/vector/v.edit/main.c	2009-09-09 15:44:53 UTC (rev 39094)
@@ -15,7 +15,7 @@
  *             Read the file COPYING that comes with GRASS
  *             for details.
  *
- * TODO:       3D support
+ * TODO:       3D support (done for move and vertexmove)
  ****************************************************************/
 
 #include "global.h"
@@ -34,7 +34,7 @@
     int i;
     int move_first, snap;
     int ret, print, layer;
-    double move_x, move_y, thresh[3];
+    double move_x, move_y, move_z, thresh[3];
 
     struct line_pnts *coord;
 
@@ -281,18 +281,19 @@
     case MODE_MOVE:
 	move_x = atof(params.move->answers[0]);
 	move_y = atof(params.move->answers[1]);
+	move_z = atof(params.move->answers[2]);
 	G_verbose_message(_("Threshold value for snapping is %.2f"),
 			  thresh[THRESH_SNAP]);
-	ret = Vedit_move_lines(&Map, BgMap, nbgmaps, List, move_x, move_y, 0.0, snap, thresh[THRESH_SNAP]);	/* TODO: 3D */
+	ret = Vedit_move_lines(&Map, BgMap, nbgmaps, List, move_x, move_y, move_z, snap, thresh[THRESH_SNAP]);
 	G_message(_("%d features moved"), ret);
 	break;
     case MODE_VERTEX_MOVE:
 	move_x = atof(params.move->answers[0]);
 	move_y = atof(params.move->answers[1]);
+	move_z = atof(params.move->answers[2]);
 	G_verbose_message(_("Threshold value for snapping is %.2f"),
 			  thresh[THRESH_SNAP]);
-	ret = Vedit_move_vertex(&Map, BgMap, nbgmaps, List, coord, thresh[THRESH_COORDS], thresh[THRESH_SNAP], move_x, move_y, 0.0,	/* TODO: 3D */
-				move_first, snap);
+	ret = Vedit_move_vertex(&Map, BgMap, nbgmaps, List, coord, thresh[THRESH_COORDS], thresh[THRESH_SNAP], move_x, move_y, move_z, move_first, snap);
 	G_message(_("%d vertices moved"), ret);
 	break;
     case MODE_VERTEX_ADD:



More information about the grass-commit mailing list