19 #include <grass/gis.h>
20 #include <grass/symbol.h>
26 G_debug(5,
" add_coor %d, %d", x, y);
27 if (chain->scount == chain->salloc) {
29 chain->sx = (
int *)G_realloc(chain->sx, chain->salloc *
sizeof(
int));
30 chain->sy = (
int *)G_realloc(chain->sy, chain->salloc *
sizeof(
int));
32 chain->sx[chain->scount] = x;
33 chain->sy[chain->scount] =
y;
51 G_debug(5,
" stroke_chain(): ch = %d", ch);
52 chain = part->chain[ch];
54 G_debug(5,
" element count = %d", chain->count);
56 for (k = 0; k < chain->count; k++) {
57 elem = chain->elem[k];
60 G_debug(5,
" LINE count = %d", elem->coor.line.count);
61 for (l = 0; l < elem->coor.line.count; l++) {
62 x = s * elem->coor.line.x[
l];
63 y = s * elem->coor.line.y[
l];
83 G_debug(5,
" ARC da = %f r = %f", da, r);
86 a1 =
PI * elem->coor.arc.a1 / 180;
89 a2 =
PI * elem->coor.arc.a2 / 180;
93 if (elem->coor.arc.clock) {
95 x = s * elem->coor.arc.x + s * r * cos(a1);
96 y = s * elem->coor.arc.y + s * r * sin(a1);
117 x = s * elem->coor.arc.x + s * r * cos(a1);
118 y = s * elem->coor.arc.y + s * r * sin(a1);
139 if (part->type == S_POLYGON) {
157 G_debug(3,
"S_stroke(): size = %d rotation = %f tolerance = %d", size,
158 rotation, tolerance);
162 s = size * Symb->scale;
164 for (i = 0; i < Symb->count; i++) {
166 part = Symb->part[i];
167 switch (part->type) {
169 for (j = 0; j < part->count; j++) {
void S_stroke(SYMBOL *Symb, int size, double rotation, int tolerance)
int G_debug(int level, const char *msg,...)
Print debugging message.
void add_coor(SYMBCHAIN *chain, int x, int y)
void G_rotate_around_point_int(int X0, int Y0, int *X1, int *Y1, double angle)
Rotate point (int version)
int stroke_chain(SYMBPART *part, int ch, double s, double rotation)