[GRASS-SVN] r57622 - grass/trunk/misc/m.nviz.image

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 8 15:27:44 PDT 2013


Author: annakrat
Date: 2013-09-08 15:27:44 -0700 (Sun, 08 Sep 2013)
New Revision: 57622

Modified:
   grass/trunk/misc/m.nviz.image/args.c
   grass/trunk/misc/m.nviz.image/local_proto.h
   grass/trunk/misc/m.nviz.image/volume.c
Log:
m.nviz.image: add flag to change normal direction of isosurfaces

Modified: grass/trunk/misc/m.nviz.image/args.c
===================================================================
--- grass/trunk/misc/m.nviz.image/args.c	2013-09-08 17:36:42 UTC (rev 57621)
+++ grass/trunk/misc/m.nviz.image/args.c	2013-09-08 22:27:44 UTC (rev 57622)
@@ -699,7 +699,13 @@
     params->isosurf_shine_const->description = _("Shininess value(s) for isosurfaces");
     params->isosurf_shine_const->guisection = _("Volumes");
     params->isosurf_shine_const->options = "0-255";
-    
+
+    params->isosurf_toggle_norm_dir = G_define_flag();
+    params->isosurf_toggle_norm_dir->key = 'n';
+    params->isosurf_toggle_norm_dir->description =
+	_("Toggles normal direction of all isosurfaces (changes light effect)");
+    params->isosurf_toggle_norm_dir->guisection = _("Volumes");
+
     /* slices */
     /* slice axis */
     params->slice = G_define_option();

Modified: grass/trunk/misc/m.nviz.image/local_proto.h
===================================================================
--- grass/trunk/misc/m.nviz.image/local_proto.h	2013-09-08 17:36:42 UTC (rev 57621)
+++ grass/trunk/misc/m.nviz.image/local_proto.h	2013-09-08 22:27:44 UTC (rev 57622)
@@ -7,6 +7,7 @@
 struct GParams
 {
     struct Flag *mode_all;
+    struct Flag *isosurf_toggle_norm_dir;
 
     struct Option 
     /* surface */

Modified: grass/trunk/misc/m.nviz.image/volume.c
===================================================================
--- grass/trunk/misc/m.nviz.image/volume.c	2013-09-08 17:36:42 UTC (rev 57621)
+++ grass/trunk/misc/m.nviz.image/volume.c	2013-09-08 22:27:44 UTC (rev 57622)
@@ -108,6 +108,10 @@
 
 	nisosurfs = GVL_isosurf_num_isosurfs(id);
 
+	if (params->isosurf_toggle_norm_dir->answer) {
+	    GVL_isosurf_set_flags(id, nisosurfs-1, 1);
+	}
+
 	/* topography (level) */
 	if (GVL_isosurf_set_att_const(id, nisosurfs-1, ATT_TOPO, level) < 0) {
 	    G_fatal_error(_("Unable to set isosurface (%d) attribute (%d) of volume %d"),



More information about the grass-commit mailing list