[GRASS-SVN] r31649 - grass-addons/visualization/nviz2/cmd
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jun 6 11:43:45 EDT 2008
Author: martinl
Date: 2008-06-06 11:43:45 -0400 (Fri, 06 Jun 2008)
New Revision: 31649
Modified:
grass-addons/visualization/nviz2/cmd/args.c
grass-addons/visualization/nviz2/cmd/change_view.c
grass-addons/visualization/nviz2/cmd/local_proto.h
grass-addons/visualization/nviz2/cmd/main.c
Log:
nviz2/cmd: parameter for 'vertical exaggeration' added
Modified: grass-addons/visualization/nviz2/cmd/args.c
===================================================================
--- grass-addons/visualization/nviz2/cmd/args.c 2008-06-06 15:03:37 UTC (rev 31648)
+++ grass-addons/visualization/nviz2/cmd/args.c 2008-06-06 15:43:45 UTC (rev 31649)
@@ -38,6 +38,16 @@
params->elev->description = _("Name of raster map(s) for elevation");
params->elev->guisection = _("Raster");
+ params->exag = G_define_option();
+ params->exag->key = "exag";
+ params->exag->key_desc = "value";
+ params->exag->type = TYPE_DOUBLE;
+ params->exag->required = NO;
+ params->exag->multiple = NO;
+ params->exag->description = _("Vertical exaggeration");
+ params->exag->answer = "1.0";
+ params->exag->options = "0-10";
+
params->pos = G_define_option();
params->pos->key = "position";
params->pos->key_desc = "x,y";
Modified: grass-addons/visualization/nviz2/cmd/change_view.c
===================================================================
--- grass-addons/visualization/nviz2/cmd/change_view.c 2008-06-06 15:03:37 UTC (rev 31648)
+++ grass-addons/visualization/nviz2/cmd/change_view.c 2008-06-06 15:43:45 UTC (rev 31649)
@@ -178,3 +178,27 @@
GS_alldraw_wire();
GS_done_draw();
}
+
+/*!
+ \brief Change z-exag value
+
+ \param data nviz data
+ \param exag exag value
+
+ \return 1
+*/
+int change_exag(nv_data *data, float exag)
+{
+ float temp;
+
+ temp = GS_global_exag();
+
+ if (exag != temp) {
+ GS_set_global_exag(exag);
+ update_ranges(data);
+
+ draw_quick(data);
+ }
+
+ return 1;
+}
Modified: grass-addons/visualization/nviz2/cmd/local_proto.h
===================================================================
--- grass-addons/visualization/nviz2/cmd/local_proto.h 2008-06-06 15:03:37 UTC (rev 31648)
+++ grass-addons/visualization/nviz2/cmd/local_proto.h 2008-06-06 15:43:45 UTC (rev 31649)
@@ -7,6 +7,7 @@
/* module flags and parameters */
struct GParams {
struct Option *elev, /* data */
+ *exag, /* misc */
*pos, *height, *persp, *twist; /* viewpoint */
};
@@ -27,6 +28,7 @@
int viewpoint_set_persp(nv_data *, int);
int viewpoint_set_twist(nv_data *, int);
void resize_window(int, int);
+int change_exag(nv_data *, float);
/* draw.c */
int draw_all_surf(nv_data *);
Modified: grass-addons/visualization/nviz2/cmd/main.c
===================================================================
--- grass-addons/visualization/nviz2/cmd/main.c 2008-06-06 15:03:37 UTC (rev 31648)
+++ grass-addons/visualization/nviz2/cmd/main.c 2008-06-06 15:43:45 UTC (rev 31649)
@@ -92,6 +92,8 @@
GS_init_view();
viewpoint_set_height(&data,
atof(params->height->answer));
+ change_exag(&data,
+ atof(params->exag->answer));
viewpoint_set_position(&data,
atof(params->pos->answers[0]),
atof(params->pos->answers[1]));
More information about the grass-commit
mailing list