grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

symbol.c File Reference
#include <grass/gis.h>
#include <grass/display.h>
#include <grass/symbol.h>
#include <grass/glocale.h>
Include dependency graph for symbol.c:

Go to the source code of this file.

Functions

static void symbol (const SYMBOL *Symb, double x0, double y0, const RGBA_Color *fill_color, const RGBA_Color *line_color, const RGBA_Color *string_color)
 
void D_symbol (const SYMBOL *Symb, double x0, double y0, const RGBA_Color *line_color, const RGBA_Color *fill_color)
 draw a symbol at pixel coordinates More...
 
void D_symbol2 (const SYMBOL *Symb, double x0, double y0, const RGBA_Color *primary_color, const RGBA_Color *secondary_color)
 draw a symbol at pixel coordinates (alternate) More...
 

Function Documentation

◆ D_symbol()

void D_symbol ( const SYMBOL Symb,
double  x0,
double  y0,
const RGBA_Color line_color,
const RGBA_Color fill_color 
)

draw a symbol at pixel coordinates

Draws a symbol (one of $GISBASE/etc/symbols/) to the active display. The starting x0,y0 coordinate corresponds to the center of the icon. The symbol must be pre-processed with S_stroke() before being sent to this function.

Example
#include <grass/display.h>
#include <grass/symbol.h>
...
SYMBOL *Symb;
Symb = S_read( symbol_name );
S_stroke( Symb, size, rotation, tolerance );
D_symbol( Symb, x0, y0, line_color, fill_color );
static double tolerance
Definition: line_dist.c:6
static uint16 x0
Definition: lrand48.c:35
void S_stroke(SYMBOL *Symb, double size, double rotation, int tolerance)
Stroke symbol to form used for Xdriver.
Definition: stroke.c:158
SYMBOL * S_read(const char *sname)
Definition: read.c:235
void D_symbol(const SYMBOL *Symb, double x0, double y0, const RGBA_Color *line_color, const RGBA_Color *fill_color)
draw a symbol at pixel coordinates
Definition: symbol.c:153
Parameters
SymbThe symbol name (e.g. basic/circle)
x0The starting x display coordinate (pixel)
y0The starting y display coordinate (pixel)
line_colorOutline color
fill_colorFill color
Returns
void

Definition at line 153 of file symbol.c.

References symbol(), and x0.

◆ D_symbol2()

void D_symbol2 ( const SYMBOL Symb,
double  x0,
double  y0,
const RGBA_Color primary_color,
const RGBA_Color secondary_color 
)

draw a symbol at pixel coordinates (alternate)

Draws a symbol (one of $GISBASE/etc/symbols/) to the active display. The same as D_symbol(), but it uses a primary and secondary color instead of line and fill color. The primary color is used to draw stroke lines (STRINGs) and as the fill color for polygons. The secondary color is used for polygon outlines.

Parameters
SymbThe symbol name (e.g. basic/circle)
x0The starting x display coordinate (pixel)
y0The starting y display coordinate (pixel)
primary_colorPrimary draw color
secondary_colorSecondary draw color
Returns
void

Definition at line 177 of file symbol.c.

References symbol(), and x0.

◆ symbol()

static void symbol ( const SYMBOL Symb,
double  x0,
double  y0,
const RGBA_Color fill_color,
const RGBA_Color line_color,
const RGBA_Color string_color 
)
static

MODULE: display AUTHOR(S): Hamish Bowman <hamish_b yahoo.com> (original contributor) (adapted from Radim Blazek's d.vect code) Glynn Clements <glynn gclements.plus.com> PURPOSE: draw a symbol at pixel coordinates COPYRIGHT: (C) 2005-2007 by M. Hamish Bowman, and the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Definition at line 23 of file symbol.c.

References color_rgba::a, color_rgba::b, SYMBCOLOR::b, SYMBPART::chain, SYMBCOLOR::color, SYMBPART::color, SYMBPART::count, SYMBOL::count, D_begin(), D_cont_abs(), D_end(), D_get_d_to_u_xconv(), D_get_d_to_u_yconv(), D_move_abs(), D_polygon_abs(), D_RGB_color(), D_stroke(), SYMBPART::fcolor, color_rgba::g, SYMBCOLOR::g, G_debug(), G_free(), SYMBOL::part, color_rgba::r, SYMBCOLOR::r, RGBA_COLOR_NONE, S_COL_DEFAULT, S_COL_DEFINED, S_COL_NONE, S_POLYGON, S_STRING, SYMBCHAIN::scount, SYMBCHAIN::sx, SYMBCHAIN::sy, SYMBPART::type, x, and x0.

Referenced by D_symbol(), D_symbol2(), GP_get_style(), GP_set_style(), and GP_set_style_thematic().