[GRASS-SVN] r50291 - in grass/trunk: lib/gmath lib/raster3d raster3d/r3.out.vtk

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 19 06:43:01 EST 2012


Author: huhabla
Date: 2012-01-19 03:43:01 -0800 (Thu, 19 Jan 2012)
New Revision: 50291

Modified:
   grass/trunk/lib/gmath/solvers_direct_cholesky_band.c
   grass/trunk/lib/raster3d/tileio.c
   grass/trunk/lib/raster3d/tilemath.c
   grass/trunk/raster3d/r3.out.vtk/main.c
   grass/trunk/raster3d/r3.out.vtk/parameters.c
   grass/trunk/raster3d/r3.out.vtk/parameters.h
Log:
Better docu. New flag in r3.out.vtk


Modified: grass/trunk/lib/gmath/solvers_direct_cholesky_band.c
===================================================================
--- grass/trunk/lib/gmath/solvers_direct_cholesky_band.c	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/lib/gmath/solvers_direct_cholesky_band.c	2012-01-19 11:43:01 UTC (rev 50291)
@@ -9,7 +9,7 @@
  * \brief Cholesky decomposition of a symmetric band matrix
  *
  * \param A (double**) the input symmetric band matrix
- * \param T (double**) the resulting lower tringular sband matrix
+ * \param T (double**) the resulting lower tringular symmetric band matrix
  * \param rows (int) number of rows
  * \param bandwidth (int) the bandwidth of the symmetric band matrix
  *

Modified: grass/trunk/lib/raster3d/tileio.c
===================================================================
--- grass/trunk/lib/raster3d/tileio.c	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/lib/raster3d/tileio.c	2012-01-19 11:43:01 UTC (rev 50291)
@@ -19,17 +19,21 @@
 /*!
  * \brief 
  *
- *  This function
+ * This function
  * returns a pointer to a tile which contains the data for the tile with index
  * <em>tileIndex</em>.  The type of the data stored in the tile depends on the type
  * specified at the initialization time of <em>map</em>.  The functionality is
  * different depending on whether <em>map</em> is old or new and depending on the
  * cache-mode of <em>map</em>.<br>
+ * 
  * If <em>map</em> is old and the cache is not used the tile with <em>tileIndex</em>
  * is read from file and stored in the buffer provided by the map structure.
  * The pointer to this buffer is returned. If the buffer already contains the
  * tile with <em>tileIndex</em> reading is skipped. Data which was stored in
- * earlier calls to <tt>Rast3d_get_tile_ptr</tt> is destroyed.  If the tile with <em>tileIndex</em> is not stored on the file corresponding to <em>map</em>, and <em>tileIndex</em> is a valid index the buffer is filled with NULL-values.<br>
+ * earlier calls to <tt>Rast3d_get_tile_ptr</tt> is destroyed.  
+ * If the tile with <em>tileIndex</em> is not stored on the file corresponding 
+ * to <em>map</em>, and <em>tileIndex</em> is a valid index the buffer is filled with NULL-values.<br>
+ * 
  * If <em>map</em> is old and the cache is used the tile with <em>tileIndex</em> is
  * read from file and stored in one of the cache buffers.  The pointer to buffer
  * is returned.  If no free cache buffer is available an unlocked cache-buffer
@@ -38,6 +42,7 @@
  * index the buffer is filled with NULL-values.  If one
  * of the cache buffers already contains the tile with <em>tileIndex</em> reading
  * is skipped and the pointer to this buffer is returned.<br>
+ * 
  * If <em>map</em> is new and the cache is not used the functionality is the same
  * as if <em>map</em> is old and the cache is not used.  If the tile with <em>tileIndex</em> 
  * is already stored on file, it is read into the buffer, if not,
@@ -46,6 +51,7 @@
  * values already stored in the buffer.  Use <tt>Rast3d_flush_tile</tt> to write the buffer
  * to the file before reusing it for a different index.  The use of this buffer
  * as write buffer is discouraged.<br>
+ * 
  * If <em>map</em> is new and the cache is used the functionality is the same as if
  * <em>map</em> is old and the cache is used with the following exception.  If <em>tileIndex</em> 
  * is a valid index and the tile with this index is not found in
@@ -56,6 +62,7 @@
  * destroyed. If a cache buffer needs to be freed up, and the tile stored in the
  * buffer has not been written to the file corresponding to <em>map</em> yet, the
  * tile is copied into the file-cache.<br>
+ * 
  * Care has to be taken if this function is used in non-cache mode since it is
  * implicitly invoked every time a read or write request is issued.  The only
  * I/O-functions for which it is safe to assume that they do not invoke
@@ -64,7 +71,7 @@
  *
  *  \param map
  *  \param tileIndex
- *  \return char * a pointer to a buffer ... if successful,
+ *  \return void * a pointer to a buffer ... if successful,
  *                 NULL ... otherwise.
  */
 

Modified: grass/trunk/lib/raster3d/tilemath.c
===================================================================
--- grass/trunk/lib/raster3d/tilemath.c	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/lib/raster3d/tilemath.c	2012-01-19 11:43:01 UTC (rev 50291)
@@ -316,7 +316,7 @@
  *
  * This function computes tile sizes with an optimal ratio between tile dimensions and
  * minimized border tile overlapping.
- * Large dimensions will be reduced mor often than small dimensions to
+ * Large dimensions (in most cases x and y) will be reduced more often than small dimensions to
  * fit the maxSize criteria.
  *
  *  \param region The region of the map
@@ -360,8 +360,8 @@
        /* Compute weighted tile sizes. Take care that the tile size is computed based on
           the dimension ratio and reduce the border tile overlapping. 
           In case one dimension is much larger than the other, reduce 
-          the large dimension by a factor till the maxSize is reached or the 
-          the other dimensions are only factor 2 smaller.*/
+          the large dimension by a factor till the maxSize is reached or till the 
+          the other dimensions are only by factor 2 smaller.*/
        if((y / x) <= 2 && (z / x) <= 2) {
            if(region->cols % divx != 0)
                x = region->cols / divx + 1;
@@ -384,6 +384,7 @@
            divz += 1;
        }
 
+       /* Avoid infinite loop */
        i++;
        if(i > 10000)
          break;

Modified: grass/trunk/raster3d/r3.out.vtk/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.vtk/main.c	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/raster3d/r3.out.vtk/main.c	2012-01-19 11:43:01 UTC (rev 50291)
@@ -433,7 +433,7 @@
     /* read and compute the scale factor */
     sscanf(param.elevscale->answer, "%lf", &scale);
     /*if LL projection, convert the elevation values to degrees */
-    if (region.proj == PROJECTION_LL) {
+    if (param.scalell->answer && region.proj == PROJECTION_LL) {
         llscale = M_PI / (180) * 6378137;
         scale /= llscale;
     }

Modified: grass/trunk/raster3d/r3.out.vtk/parameters.c
===================================================================
--- grass/trunk/raster3d/r3.out.vtk/parameters.c	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/raster3d/r3.out.vtk/parameters.c	2012-01-19 11:43:01 UTC (rev 50291)
@@ -91,7 +91,6 @@
     param.vectormaps->description =
 	_("Three (x,y,z) 3D raster maps to create vector values [xmap,ymap,zmap]");
 
-
     param.elevscale = G_define_option();
     param.elevscale->key = "elevscale";
     param.elevscale->type = TYPE_DOUBLE;
@@ -127,6 +126,13 @@
     param.coorcorr->description =
 	_("Correct the coordinates to fit the VTK-OpenGL precision");
 
+    param.scalell = G_define_flag();
+    param.scalell->key = 'l';
+    param.scalell->guisection = "Advanced options";
+    param.scalell->description =
+	_("Do not convert the top-bottom resolution in case of lat long projection to meters");
+
+
     /* Maybe needed in the future
      * param.xml = G_define_flag ();
      * param.xml->key = 'x';

Modified: grass/trunk/raster3d/r3.out.vtk/parameters.h
===================================================================
--- grass/trunk/raster3d/r3.out.vtk/parameters.h	2012-01-19 11:30:51 UTC (rev 50290)
+++ grass/trunk/raster3d/r3.out.vtk/parameters.h	2012-01-19 11:43:01 UTC (rev 50291)
@@ -23,7 +23,7 @@
 {
     struct Option *input, *output, *rgbmaps, *vectormaps, *null_val, *top,
 	*bottom, *decimals, *elevscale;
-    struct Flag *mask, *point, *origin, *structgrid, *coorcorr;
+    struct Flag *mask, *point, *origin, *structgrid, *coorcorr, *scalell;
     /*struct Flag *xml; *//*maybe xml support in the future */
 } paramType;
 



More information about the grass-commit mailing list