[GRASS-dev] g3d lib bug?

Soeren Gebbert soerengebbert at gmx.de
Sat Aug 5 10:02:10 EDT 2006


Dear devs,
while extending some g3d modules i noticed that the resampling function
(nearest neighbor) and the window structure is not set when a new g3d map
is created (G3d_openCellNew()). Only G3d_openCellOld() sets those values.

Was there a specific reason to not implement this in G3d_openCellNew()?

I do need this functionality!

Without setting the resampling function and the window of the new map,
i do not have access to values i have already written with G3d_putValue(). 
G3d_getValue() will give only null values or will crash.

I have added a diff of the changes i want to make to lib/g3d/g3dopen.c.

What do you think?

Best regards
Soeren

cvs server: Diffing .
Index: g3dopen.c
===================================================================
RCS file: /home/grass/grassrepository/grass6/lib/g3d/g3dopen.c,v
retrieving revision 2.4
diff -u -r2.4 g3dopen.c
--- g3dopen.c   6 May 2006 22:50:17 -0000       2.4
+++ g3dopen.c   5 Aug 2006 13:56:52 -0000
@@ -320,6 +320,11 @@
     return (void *) NULL;
   }

+  /*Set the map window to the map region */
+  G3d_regionCopy (&(map->window), region);
+  /*Set the resampling function to nearest neighbor for data access */
+  G3d_getNearestNeighborFunPtr (&(map->resampleFun));
+
   G3d_maskOff (map);

   return (void *) map;




More information about the grass-dev mailing list