Dear All,

this is my first try in producing a patch for GRASS, so please bear with me...

The module v.edit includes the tools 'move' and 'vertexmove', that use
routines from the vector editing library 'vedit'. These routines are
already capable of performing these changes in 3D, and the only
changes are needed in the user interface of v.edit.

The attached file is a product of "svn diff" that shows the changes in
module 'v.edit' in 'trunk'.

If someone feels this is useful, please feel free to apply the
changes. I do not normally use svn for anything, so if there's a
better way to do this thing, just let me know.

Best,

Harri K.

--
Harri Kiiskinen (harkiisk[at]gmail.com)
Index: main.c
===================================================================
--- main.c	(revision 39080)
+++ main.c	(working copy)
@@ -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"
@@ -33,7 +33,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;
 
@@ -261,18 +261,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:
Index: args.c
===================================================================
--- args.c	(revision 39080)
+++ args.c	(working copy)
@@ -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";
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to