[GRASS-dev] colors for volumes

Helena Mitasova hmitaso at unity.ncsu.edu
Wed Nov 10 23:33:26 EST 2010


We are trying to work with some volume data and we haven't been able to find a module that 
would actually create a color file for grid3d.
Apparently nviz reads the colors from the color table if it is present
http://trac.osgeo.org/grass/browser/grass/branches/develbranch_6/lib/ogsf/Gvl3.c

and the G3D library provides functions for color support
http://grass.osgeo.org/programming6/g3dlib.html

G3D Color Support
Applications can use the standard grass functions to work with colors, except for the file manipulations.
int G3d_removeColor(char *name) Removes the primary and/or secondary color file. See G_remove_colr for details.
Returns always 0.
int G3d_readColors(char *name, char *mapset, struct Colors colors) Reads color file for map name in mapset into the colors structure. See G_read_colors(Raster_Color_Table) for details and return values.
int G3d_writeColors(char *name, char *mapset, struct Colors colors)Writes colors stored in colors structure into the color file for map name in mapset. See G_write_colors (Raster_Color_Table) for details and return values.

but there is no r3.color (based on r.color?) and rather surprisingly v.vol.rst does not create a color file (as v.surf.rst does),
neither do r.to.rast3 or v.to.rast3 (those probably are OK to use the default colors).
I assume that writing or copying a color file into the relevant grid3d directory would work (I can try it out),
but that is not a solution for normal users - I am wondering how difficult it would be to write r3.color module,
to make the colors on 3D rasters adjustable

Helena 


More information about the grass-dev mailing list