20#include <grass/symbol.h>
24void add_coor(SYMBCHAIN *chain,
double x,
double y)
26 G_debug(5,
" add_coor %f, %f",
x, y);
27 if (chain->scount == chain->salloc) {
30 (
double *)G_realloc(chain->sx, chain->salloc *
sizeof(
double));
32 (
double *)G_realloc(chain->sy, chain->salloc *
sizeof(
double));
34 chain->sx[chain->scount] =
x;
35 chain->sy[chain->scount] = y;
53 G_debug(5,
" stroke_chain(): ch = %d", ch);
54 chain = part->chain[ch];
56 G_debug(5,
" element count = %d", chain->count);
58 for (k = 0; k < chain->count; k++) {
59 elem = chain->elem[k];
62 G_debug(5,
" LINE count = %d", elem->coor.line.count);
63 for (
l = 0;
l < elem->coor.line.count;
l++) {
64 x = s * elem->coor.line.x[
l];
65 y = s * elem->coor.line.y[
l];
85 G_debug(5,
" ARC da = %f r = %f", da,
r);
88 a1 =
PI * elem->coor.arc.a1 / 180;
91 a2 =
PI * elem->coor.arc.a2 / 180;
95 if (elem->coor.arc.clock) {
97 x = s * elem->coor.arc.x + s *
r * cos(a1);
98 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) {
158void S_stroke(SYMBOL *Symb,
double size,
double rotation,
int tolerance)
164 G_debug(3,
"S_stroke(): size = %.2f, rotation = %.2f, tolerance = %d", size,
165 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++) {
int G_debug(int level, const char *msg,...)
Print debugging message.
void G_rotate_around_point(double X0, double Y0, double *X1, double *Y1, double angle)
Rotate point (double version)
void add_coor(SYMBCHAIN *chain, double x, double y)
void S_stroke(SYMBOL *Symb, double size, double rotation, int tolerance)
Stroke symbol to form used for Xdriver.
int stroke_chain(SYMBPART *part, int ch, double s, double rotation)