19 #include <grass/gis.h>
20 #include <grass/symbol.h>
27 G_debug(5,
" add_coor %f, %f",
x, y);
28 if (chain->scount == chain->salloc) {
30 chain->sx = (
double *)G_realloc(chain->sx, chain->salloc *
sizeof(
double));
31 chain->sy = (
double *)G_realloc(chain->sy, chain->salloc *
sizeof(
double));
33 chain->sx[chain->scount] =
x;
34 chain->sy[chain->scount] = y;
43 int stroke_chain(SYMBPART *part,
int ch,
double s,
double rotation)
52 G_debug(5,
" stroke_chain(): ch = %d", ch);
53 chain = part->chain[ch];
55 G_debug(5,
" element count = %d", chain->count);
57 for (k = 0; k < chain->count; k++) {
58 elem = chain->elem[k];
61 G_debug(5,
" LINE count = %d", elem->coor.line.count);
62 for (
l = 0;
l < elem->coor.line.count;
l++) {
63 x = s * elem->coor.line.x[
l];
64 y = s * elem->coor.line.y[
l];
84 G_debug(5,
" ARC da = %f r = %f", da,
r);
87 a1 =
PI * elem->coor.arc.a1 / 180;
90 a2 =
PI * elem->coor.arc.a2 / 180;
94 if (elem->coor.arc.clock) {
96 x = s * elem->coor.arc.x + s *
r * cos(a1);
97 y = s * elem->coor.arc.y + s *
r * sin(a1);
118 x = s * elem->coor.arc.x + s *
r * cos(a1);
119 y = s * elem->coor.arc.y + s *
r * sin(a1);
140 if (part->type == S_POLYGON) {
158 void S_stroke(SYMBOL *Symb,
double size,
double rotation,
int tolerance)
164 G_debug(3,
"S_stroke(): size = %.2f, rotation = %.2f, tolerance = %d",
165 size, rotation, tolerance);
169 s = size * Symb->scale;
171 for (i = 0; i < Symb->count; i++) {
173 part = Symb->part[i];
174 switch (part->type) {
176 for (j = 0; j < part->count; j++) {