1
2 /****************************************************************************
3 *
4 * MODULE: r.out.vtk
5 *
6 * AUTHOR(S): Original author
7 * Soeren Gebbert soerengebbert@gmx.de
8 * 08 23 2005 Berlin
9 * PURPOSE: Converts raster maps into the VTK-Ascii format
10 *
11 * COPYRIGHT: (C) 2005 by the GRASS Development Team
12 *
13 * This program is free software under the GNU General Public
14 * License (>=v2). Read the file COPYING that comes with GRASS
15 * for details.
16 *
17 *****************************************************************************/
18 #include <grass/gis.h>
19 #include <grass/glocale.h>
20 #include <grass/config.h>
21 #include "parameters.h"
22
23 /* ************************************************************************* */
24 /* PARAMETERS ************************************************************** */
25 /* ************************************************************************* */
26
set_params()27 void set_params()
28 {
29 param.input = G_define_standard_option(G_OPT_R_INPUTS);
30 param.input->required = NO;
31 param.input->description =
32 _("Raster map(s) to be converted to VTK-ASCII data format");
33
34 param.output = G_define_standard_option(G_OPT_F_OUTPUT);
35 param.output->required = NO;
36 param.output->description = _("Name for VTK-ASCII output file");
37
38 param.elevationmap = G_define_standard_option(G_OPT_R_ELEV);
39 param.elevationmap->required = NO;
40
41 param.null_val = G_define_option();
42 param.null_val->key = "null";
43 param.null_val->type = TYPE_DOUBLE;
44 param.null_val->required = NO;
45 param.null_val->description = _("Value to represent no data cell");
46 param.null_val->answer = "-99999.99";
47
48 param.elev = G_define_option();
49 param.elev->key = "z";
50 param.elev->type = TYPE_DOUBLE;
51 param.elev->required = NO;
52 param.elev->description =
53 _("Constant elevation (if no elevation map is specified)");
54 param.elev->answer = "0.0";
55
56 param.point = G_define_flag();
57 param.point->key = 'p';
58 param.point->description =
59 _("Create VTK point data instead of VTK cell data (if no elevation map is given)");
60
61 param.rgbmaps = G_define_option();
62 param.rgbmaps->key = "rgbmaps";
63 param.rgbmaps->type = TYPE_STRING;
64 param.rgbmaps->required = NO;
65 param.rgbmaps->gisprompt = "old,cell,raster";
66 param.rgbmaps->multiple = YES;
67 param.rgbmaps->guisection = "Advanced options";
68 param.rgbmaps->description =
69 _("Three (r,g,b) raster maps to create RGB values [redmap,greenmap,bluemap]");
70
71 param.vectmaps = G_define_option();
72 param.vectmaps->key = "vectormaps";
73 param.vectmaps->type = TYPE_STRING;
74 param.vectmaps->required = NO;
75 param.vectmaps->gisprompt = "old,cell,raster";
76 param.vectmaps->multiple = YES;
77 param.vectmaps->guisection = "Advanced options";
78 param.vectmaps->description =
79 _("Three (x,y,z) raster maps to create vector values [xmap,ymap,zmap]");
80
81 param.elevscale = G_define_option();
82 param.elevscale->key = "zscale";
83 param.elevscale->type = TYPE_DOUBLE;
84 param.elevscale->required = NO;
85 param.elevscale->description = _("Scale factor for elevation");
86 param.elevscale->guisection = "Advanced options";
87 param.elevscale->answer = "1.0";
88
89 param.decimals = G_define_option();
90 param.decimals->key = "precision";
91 param.decimals->type = TYPE_INTEGER;
92 param.decimals->required = NO;
93 param.decimals->multiple = NO;
94 param.decimals->answer = "12";
95 param.decimals->options = "0-20";
96 param.decimals->guisection = "Advanced options";
97 param.decimals->description =
98 _("Number of significant digits (floating point only)");
99
100 param.usestruct = G_define_flag();
101 param.usestruct->key = 's';
102 param.usestruct->guisection = "Advanced options";
103 param.usestruct->description =
104 _("Use structured grid for elevation (not recommended)");
105
106 param.usetriangle = G_define_flag();
107 param.usetriangle->key = 't';
108 param.usetriangle->guisection = "Advanced options";
109 param.usetriangle->description =
110 _("Use polydata-trianglestrips for elevation grid creation");
111
112 param.usevertices = G_define_flag();
113 param.usevertices->key = 'v';
114 param.usevertices->guisection = "Advanced options";
115 param.usevertices->description =
116 _("Use polydata-vertices for elevation grid creation (to use with vtkDelauny2D)");
117
118 param.origin = G_define_flag();
119 param.origin->key = 'o';
120 param.origin->guisection = "Advanced options";
121 param.origin->description =
122 _("Scale factor affects the origin (if no elevation map is given)");
123
124 param.coorcorr = G_define_flag();
125 param.coorcorr->key = 'c';
126 param.coorcorr->guisection = "Advanced options";
127 param.coorcorr->description =
128 _("Correct the coordinates to match the VTK-OpenGL precision");
129
130
131 /*
132 * param.mask = G_define_flag ();
133 * param.mask->key = 'm';
134 * param.mask->description = _("Use mask (if exists) with input maps");
135 *
136 * Maybe needed in the future
137 * param.xml = G_define_flag ();
138 * param.xml->key = 'x';
139 * param.xml->description = "Write XML-VTK-format";
140 */
141 }
142