[GRASS-dev] Display library documentation?

Moritz Lennert mlennert at club.worldonline.be
Tue Sep 15 03:06:26 PDT 2015


On 14/09/15 15:53, Vaclav Petras wrote:
> Hi,
>
> is there some documentation on how to use the display library, i.e. how
> to write a d.* module?

I imagine you looked at 
https://grass.osgeo.org/programming7/displaylib.html ?


> I've tried reading d.vect code but I miss the
> general rules and concepts like how to set color or which coordinates

Have you checked display_shape() in shape.c and the individual display_* 
functions in the relevant files (area.c, line.c) for the different types 
of features ?

The color is set with D_RGB_color which takes a color struct as input.
Then the feature is drawn with 
D_polygon_abs/D_polyline_abs/D_polydots_abs which take the coordinates 
from the line struct Points which is filled with info using 
Vect_read_line().

> should be used when as well as information which functions should be
> used in which case like what is the difference between D_symbol and
> D_symbol2.

 From the programmer's manual section on D_Symbol2:

"The same as D_symbol(), but it uses a primary and secondary color 
instead of line and fill color. "

Moritz




More information about the grass-dev mailing list