parameters.c 5.0 KB

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