19 #include <grass/gis.h>
20 #include <grass/symbol.h>
24 #define round(x) ((int) floor(0.5 + (x)))
29 G_debug(5,
" add_coor %d, %d", x, y);
30 if (chain->scount == chain->salloc) {
32 chain->sx = (
int *)G_realloc(chain->sx, chain->salloc *
sizeof(
int));
33 chain->sy = (
int *)G_realloc(chain->sy, chain->salloc *
sizeof(
int));
35 chain->sx[chain->scount] = x;
36 chain->sy[chain->scount] =
y;
54 G_debug(5,
" stroke_chain(): ch = %d", ch);
55 chain = part->chain[ch];
57 G_debug(5,
" element count = %d", chain->count);
59 for (k = 0; k < chain->count; k++) {
60 elem = chain->elem[k];
63 G_debug(5,
" LINE count = %d", elem->coor.line.count);
64 for (l = 0; l < elem->coor.line.count; l++) {
65 x = s * elem->coor.line.x[
l];
66 y = s * elem->coor.line.y[
l];
86 G_debug(5,
" ARC da = %f r = %f", da, r);
89 a1 =
PI * elem->coor.arc.a1 / 180;
92 a2 =
PI * elem->coor.arc.a2 / 180;
96 if (elem->coor.arc.clock) {
98 x = s * elem->coor.arc.x + s * r * cos(a1);
99 y = s * elem->coor.arc.y + s * r * sin(a1);
120 x = s * elem->coor.arc.x + s * r * cos(a1);
121 y = s * elem->coor.arc.y + s * r * sin(a1);
142 if (part->type == S_POLYGON) {
160 G_debug(3,
"S_stroke(): size = %d rotation = %f tolerance = %d", size,
161 rotation, tolerance);
165 s = size * Symb->scale;
167 for (i = 0; i < Symb->count; i++) {
169 part = Symb->part[i];
170 switch (part->type) {
172 for (j = 0; j < part->count; j++) {
void S_stroke(SYMBOL *Symb, int size, double rotation, int tolerance)
void G_rotate_around_point(double X0, double Y0, double *X1, double *Y1, double angle)
Rotate point (double version)
int G_debug(int level, const char *msg,...)
Print debugging message.
void add_coor(SYMBCHAIN *chain, int x, int y)
int stroke_chain(SYMBPART *part, int ch, double s, double rotation)