38#define ATTR_SET(a,n) ((a) && (*(agxget(n,a->index)) != '\0'))
45#define MIN_POINT 0.0003
124 .
peripheries = 1, .sides = 4, .option = {.underline =
true}};
132 .
regular =
true, .peripheries = 2, .sides = 1};
134 .
peripheries = 1, .sides = 3, .orientation = 180.0};
136 .
peripheries = 1, .sides = 4, .orientation = 180.0, .distortion = -0.4};
138 .
peripheries = 1, .sides = 5, .orientation = 180.0, .distortion = -0.64};
145 .option = {.diagonals =
true, .auxlabels =
true}};
149 .option = {.diagonals =
true}};
153 .option = {.diagonals =
true, .auxlabels =
true}};
365static double quant(
double val,
double q)
367 return ceil(val / q) * q;
365static double quant(
double val,
double q) {
…}
379 c = a * L0.
x + b * L0.
y;
381 s0 = a * p0.
x + b * p0.
y - c >= 0;
382 s1 = a * p1.
x + b * p1.
y - c >= 0;
434 return p->
sides <= 2;
476 if (
streq(p,
"filled")) {
479 }
else if (
streq(p,
"rounded")) {
486 }
else if (
streq(p,
"diagonals")) {
493 }
else if (
streq(p,
"invis")) {
496 }
else if (
streq(p,
"radial")) {
557 AF[1].
x = AF[0].
x - 2 * p.
x;
576 for (
size_t seg = 0; seg < sides; seg++) {
584 const double d = hypot(
dx,
dy);
585 rbconst = fmin(rbconst, d / 3.0);
587 for (
size_t seg = 0; seg < sides; seg++) {
595 const double d = hypot(
dx,
dy);
628 for (
size_t seg = 0; seg < sides; seg++) {
629 pointf C[] = {
B[3 * seg + 2],
B[3 * seg + 4]};
648 for (
size_t seg = 0; seg < sides; seg++) {
649 pts[i++] =
B[4 * seg];
650 pts[i++] =
B[4 * seg + 1];
651 pts[i++] =
B[4 * seg + 1];
652 pts[i++] =
B[4 * seg + 2];
653 pts[i++] =
B[4 * seg + 2];
654 pts[i++] =
B[4 * seg + 3];
686 return (line[0].x + line[1].x) / 2;
695 return (line[0].y + line[1].y) / 2;
723 }
else if (style.
shape != 0) {
737 switch (
mode.shape) {
741 for (
size_t seg = 1; seg < sides; seg++)
743 D[0] =
B[3 * (sides - 1) + 4];
744 D[sides] =
B[3 * (sides - 1) + 2];
749 const size_t sseg = sides - 1;
750 C[0] =
B[3 * sseg + 2];
751 C[1] =
B[3 * sseg + 4];
752 C[2].x =
C[1].x + (
C[0].x -
B[3 * sseg + 3].x);
753 C[2].y =
C[1].y + (
C[0].y -
B[3 * sseg + 3].y);
776 D[2].
x =
B[2].x + (
B[3].x -
B[4].x) / 3;
777 D[2].y =
B[2].y + (
B[3].y -
B[4].y) / 3;
778 D[3].x =
B[3].x + (
B[3].x -
B[4].x) / 3;
779 D[3].y =
B[3].y + (
B[3].y -
B[4].y) / 3;
780 for (
size_t seg = 4; seg < sides + 2; seg++)
781 D[seg] = AF[seg - 2];
808 D[1].
x = AF[0].
x - (AF[0].
x -
B[1].x) / 4;
809 D[1].y = AF[0].
y + (
B[3].y -
B[4].y) / 3;
810 D[2].x = AF[0].
x - 2 * (AF[0].
x -
B[1].x);
812 D[3].x = AF[0].
x - 2.25 * (AF[0].
x -
B[1].x);
816 for (
size_t seg = 4; seg < sides + 3; seg++)
817 D[seg] = AF[seg - 3];
835 C[0].x =
B[1].x + (
B[11].x -
B[0].x);
836 C[0].y =
B[1].y + (
B[11].y -
B[0].y);
865 D[2].
x =
B[3].x + (
B[4].x -
B[3].x);
866 D[2].y =
B[3].y + (
B[4].y -
B[3].y);
867 D[3].x =
D[2].x + (
B[3].x -
B[2].x);
868 D[3].y =
D[2].y + (
B[3].y -
B[2].y);
869 D[4].x =
D[3].x + (
B[4].x -
B[3].x);
870 D[4].y =
D[3].y + (
B[4].y -
B[3].y);
871 D[5].x =
D[4].x + (
D[2].x -
D[3].x);
872 D[5].y =
D[4].y + (
D[2].y -
D[3].y);
874 D[9].x =
B[6].x + (
B[5].x -
B[6].x);
875 D[9].y =
B[6].y + (
B[5].y -
B[6].y);
876 D[8].x =
D[9].x + (
B[6].x -
B[7].x);
877 D[8].y =
D[9].y + (
B[6].y -
B[7].y);
878 D[7].x =
D[8].x + (
B[5].x -
B[6].x);
879 D[7].y =
D[8].y + (
B[5].y -
B[6].y);
880 D[6].x =
D[7].x + (
D[9].x -
D[8].x);
881 D[6].y =
D[7].y + (
D[9].y -
D[8].y);
889 C[1].x =
D[2].x - (
D[3].x -
D[2].x);
890 C[1].y =
D[2].y - (
D[3].y -
D[2].y);
891 C[2].x =
C[1].x + (
D[4].x -
D[3].x);
892 C[2].y =
C[1].y + (
D[4].y -
D[3].y);
896 C[1].x =
D[6].x - (
D[7].x -
D[6].x);
897 C[1].y =
D[6].y - (
D[7].y -
D[6].y);
898 C[2].x =
C[1].x + (
D[8].x -
D[7].x);
899 C[2].y =
C[1].y + (
D[8].y -
D[7].y);
927 D[0].x =
mid_x(AF) + (AF[0].
x - AF[1].
x)/8;
928 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)*3/2;
929 D[1].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/4;
933 D[3].x =
D[2].x + (
B[2].x -
B[3].x)/2;
936 D[4].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y);
940 D[6].y =
D[4].y - (
B[3].y-
B[4].y)/4;
941 D[7].x =
D[6].x + (
B[2].x -
B[3].x);
942 D[7].y =
D[6].y + (
B[3].y -
B[4].y)/2;
944 D[8].y =
D[0].y + (
B[3].y -
B[4].y)/4;
951 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
974 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
976 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
978 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
980 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
981 D[4].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1006 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1009 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1010 D[2].x =
D[1].x + (
B[2].x-
B[3].x)/2;
1013 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/2;
1014 D[4].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1018 D[6].x =
mid_x(AF) - (
B[2].x-
B[3].x)/4;
1028 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1051 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1054 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/4;
1055 D[2].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1056 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1057 D[3].x =
mid_x(AF) - (
B[2].x-
B[3].x)/4;
1059 D[4].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1069 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1092 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x);
1093 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1094 D[1].x =
D[0].x - (
B[2].x-
B[3].x);
1095 D[1].y =
D[0].y + (
B[3].y-
B[4].y);
1097 D[2].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1098 D[3].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/4;
1108 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1131 D[0].x =
mid_x(AF) + (AF[0].
x - AF[1].
x)/8 + (
B[2].x-
B[3].x)/2;
1132 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1133 D[1].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/8;
1136 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1137 D[3].x =
D[2].x - (
B[2].x-
B[3].x)/2;
1140 D[4].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)/4;
1141 D[5].x =
D[0].x - (
B[2].x-
B[3].x)/2;
1144 D[6].y =
D[5].y - (
B[3].y-
B[4].y)/2;
1153 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1160 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1184 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1185 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1188 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1196 D[0].x = AF[1].
x + (
B[2].x-
B[3].x);
1197 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1198 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1201 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1210 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1234 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1236 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1237 D[2].x =
D[1].x - 2*(
B[3].y-
B[4].y);
1246 D[0].x = AF[0].
x - (
B[2].x-
B[3].x);
1247 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1249 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1250 D[2].x =
D[1].x - (
B[3].y-
B[4].y);
1260 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1285 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1286 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1287 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1290 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1298 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1299 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1300 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1303 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1311 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1312 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1313 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1316 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1324 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1325 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1326 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1329 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1338 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1342 C[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1345 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1367 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x);
1368 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1369 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1372 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1380 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x);
1381 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1382 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1385 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1394 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1401 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1421 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1423 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1425 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1427 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1431 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1432 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1433 C[1].x =
C[0].x + (
B[2].x-
B[3].x)/4;
1434 C[1].y =
C[0].y - (
B[3].y-
B[4].y)/4;
1438 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1439 C[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)/8;
1440 C[1].x =
C[0].x + (
B[2].x-
B[3].x)/4;
1441 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/4;
1445 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1446 C[0].y = AF[2].
y + (
B[3].y-
B[4].y)*3/4;
1447 C[1].x = AF[0].
x - (
B[2].x-
B[3].x)/4;
1465 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/2;
1466 D[0].y =
mid_y(&AF[1]) + (
B[2].x-
B[3].x)/2;
1468 D[1].y =
mid_y(&AF[1]) - (
B[2].x-
B[3].x)/2;
1469 D[2].x =
mid_x(AF) - (
B[2].x-
B[3].x)/2;
1477 C[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1478 C[0].y =
mid_y(&AF[1]) + (
B[2].x-
B[3].x)*3/4;
1480 C[1].y =
mid_y(&AF[1]) - (
B[2].x-
B[3].x)*3/4;
1481 C[2].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1489 C[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1492 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1498 C[1].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1499 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1515 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1516 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1518 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1519 D[2].x =
D[0].x - (
B[2].x-
B[3].x)/8;
1520 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/8;
1522 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1524 D[4].y =
D[3].y + (
B[3].y-
B[4].y)/8;
1529 D[7].x =
D[6].x - (
B[2].x-
B[3].x)/8;
1531 D[8].x =
D[7].x - (
B[2].x-
B[3].x)/8;
1535 D[10].x =
D[8].x + (
B[2].x-
B[3].x)/8;
1555 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1560 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1562 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1569 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1586 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1587 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1588 D[1].x =
D[0].x + (
B[2].x-
B[3].x)/8;
1589 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1591 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/4;
1593 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1594 D[4].x =
D[3].x - (
B[2].x-
B[3].x)/4;
1596 D[5].x =
D[4].x - (
B[2].x-
B[3].x)/8;
1610 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1615 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1617 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1626 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1642 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1643 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1645 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1646 D[2].x =
D[0].x - (
B[2].x-
B[3].x)/8;
1647 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/8;
1649 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1651 D[4].y =
D[3].y + (
B[3].y-
B[4].y)/8;
1656 D[7].x =
D[6].x - (
B[2].x-
B[3].x)/8;
1658 D[8].x =
D[7].x - (
B[2].x-
B[3].x)/8;
1662 D[10].x =
D[8].x + (
B[2].x-
B[3].x)/8;
1687 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1704 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1705 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1706 D[1].x =
D[0].x + (
B[2].x-
B[3].x)/8;
1707 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1709 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/4;
1711 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1712 D[4].x =
D[3].x - (
B[2].x-
B[3].x)/4;
1714 D[5].x =
D[4].x - (
B[2].x-
B[3].x)/8;
1733 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1756 D[0].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1757 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1759 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1762 D[3].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1764 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1765 D[4].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1766 D[5].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1767 D[5].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1768 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1770 D[7].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1773 D[8].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1796 D[0].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1797 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1799 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1801 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1802 D[3].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1803 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1804 D[4].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1806 D[5].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1809 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1831 D[0].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1832 D[1].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1833 D[1].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1834 D[2].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1837 D[3].y = AF[1].
y - (AF[1].
y - AF[2].
y)/2;
1838 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1840 D[5].y = AF[2].
y + (
B[3].y-
B[4].y)/2;
1841 D[5].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1842 D[6].y = AF[3].
y + (
B[3].y -
B[4].y)/2;
1867 D[0].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1868 D[1].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1869 D[1].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1870 D[2].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1873 D[3].y = AF[1].
y - (AF[1].
y - AF[2].
y)/2;
1874 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1876 D[5].y = AF[2].
y + (
B[3].y-
B[4].y)/2;
1877 D[5].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1878 D[6].y = AF[3].
y + (
B[3].y -
B[4].y)/2;
1879 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1880 D[7].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1937 char *p, *sfile, *fxd;
1938 double temp,
alpha, beta, gamma;
1939 double orientation, distortion, skew;
1940 double scalex, scaley;
1941 double width, height, marginx, marginy, spacex;
1945 bool regular = !!
ND_shape(n)->polygon->regular;
1946 size_t peripheries =
ND_shape(n)->polygon->peripheries;
1947 size_t sides =
ND_shape(n)->polygon->sides;
1948 orientation =
ND_shape(n)->polygon->orientation;
1950 distortion =
ND_shape(n)->polygon->distortion;
1966 width = height = sz;
1970 width = height =
INCH2PS(fmin(width, height));
1989 if (dimen.
x > 0 || dimen.
y > 0) {
1992 if ((p =
agget(n,
"margin"))) {
1993 marginx = marginy = 0;
1994 const int i = sscanf(p,
"%lf,%lf", &marginx, &marginy);
1995 marginx = fmax(marginx, 0);
1996 marginy = fmax(marginy, 0);
2009 spacex = dimen.
x -
ND_label(n)->dimen.x;
2014 dimen.
x =
quant(dimen.
x, temp);
2015 dimen.
y =
quant(dimen.
y, temp);
2018 imagesize.
x = imagesize.
y = 0;
2025 sfile =
agget(n,
"shapefile");
2027 if (imagesize.
x == -1 && imagesize.
y == -1) {
2029 "No or improper shapefile=\"%s\" for node \"%s\"\n",
2030 sfile ? sfile :
"<nil>",
agnameof(n));
2031 imagesize.
x = imagesize.
y = 0;
2038 }
else if ((sfile =
agget(n,
"image")) && *sfile !=
'\0') {
2040 if (imagesize.
x == -1 && imagesize.
y == -1) {
2042 "No or improper image=\"%s\" for node \"%s\"\n",
2043 sfile ? sfile :
"<nil>",
agnameof(n));
2044 imagesize.
x = imagesize.
y = 0;
2053 pointf bb = {.
x = fmax(dimen.
x, imagesize.
x),
2054 .y = fmax(dimen.
y, imagesize.
y)};
2064 p =
agget(n,
"labelloc");
2065 if (p && (p[0] ==
't' || p[0] ==
'b'))
2070 const bool isBox = sides == 4 && fabs(fmod(orientation, 90)) < 0.5
2083 if (height > temp &&
ND_label(n)->valign ==
'c') {
2087 bb.
x *= sqrt(1. / (1. -
SQR(bb.
y / height)));
2094 temp = cos(
M_PI / (
double)sides);
2108 if (*fxd ==
's' &&
streq(fxd,
"shape")) {
2109 bb = (
pointf){.
x = width, .y = height};
2110 poly->option.fixedshape =
true;
2115 "node '%s', graph '%s' size too small for label\n",
2117 bb = (
pointf){.
x = width, .y = height};
2119 bb.
x = width = fmax(width, bb.
x);
2120 bb.
y = height = fmax(height, bb.
y);
2127 width = height = bb.
x = bb.
y = fmax(bb.
x, bb.
y);
2133 ND_label(n)->space.x = fmax(dimen.
x, bb.
x) - spacex;
2135 else if (dimen.
y < bb.
y) {
2136 temp = bb.
x * sqrt(1.0 -
SQR(dimen.
y) /
SQR(bb.
y));
2137 ND_label(n)->space.x = fmax(dimen.
x, temp) - spacex;
2140 ND_label(n)->space.x = dimen.
x - spacex;
2142 ND_label(n)->space.x = dimen.
x - spacex;
2145 if (!
poly->option.fixedshape) {
2146 temp = bb.
y - min_bb.
y;
2147 if (dimen.
y < imagesize.
y)
2148 temp += imagesize.
y - dimen.
y;
2155 size_t outp = peripheries;
2156 if (peripheries < 1)
2159 if (peripheries >= 1 &&
penwidth > 0) {
2168 pointf P = {.
x = bb.
x / 2., .y = bb.
y / 2.};
2169 vertices[0] = (
pointf){.
x = -P.
x, .y = -P.
y};
2171 if (peripheries > 1) {
2172 for (
size_t j = 1, i = 2; j < peripheries; j++) {
2175 vertices[i] = (
pointf){.
x = -P.
x, .y = -P.
y};
2184 if (outp > peripheries) {
2188 size_t i = sides * peripheries;
2189 vertices[i] = (
pointf){.
x = -P.
x, .y = -P.
y};
2193 outline_bb.
x = 2. * P.
x;
2194 outline_bb.
y = 2. * P.
y;
2211 double sinx = 0, cosx = 0,
xmax,
ymax;
2219 double angle, sectorangle, sidelength, skewdist, gdistortion, gskew;
2220 sectorangle = 2. *
M_PI / (double)sides;
2221 sidelength = sin(sectorangle / 2.);
2222 skewdist = hypot(fabs(distortion) + fabs(skew), 1.);
2223 gdistortion = distortion *
SQRT2 / cos(sectorangle / 2.);
2225 angle = (sectorangle -
M_PI) / 2.;
2228 pointf R = {.
x = .5 * cosx, .y = .5 * sinx};
2230 angle += (
M_PI - sectorangle) / 2.;
2231 for (
size_t i = 0; i < sides; i++) {
2234 angle += sectorangle;
2237 R.
x += sidelength * cosx;
2238 R.
y += sidelength * sinx;
2242 .
x = R.
x * (skewdist + R.
y * gdistortion) + R.
y * gskew,
2249 P.
x = P.
y = hypot(P.
x, P.
y);
2264 vertices[1] = (
pointf){.
x = -P.
x, .y = P.
y};
2265 vertices[2] = (
pointf){.
x = -P.
x, .y = -P.
y};
2266 vertices[3] = (
pointf){.
x = P.
x, .y = -P.
y};
2278 scalex = bb.
x /
xmax;
2279 scaley = bb.
y /
ymax;
2282 for (i = 0; i < sides; i++) {
2292 for (
size_t j = 1; j < sides; j++) {
2293 Q = vertices[(i - j) % sides];
2299 beta = atan2(R.
y - Q.
y, R.
x - Q.
x);
2301 for (i = 0; i < sides; i++) {
2314 for (
size_t j = 1; j < sides; j++) {
2315 R = vertices[(i + j) % sides];
2322 beta = atan2(R.
y - Q.
y, R.
x - Q.
x);
2327 temp =
GAP / sin(gamma);
2330 sinx = sin(
alpha - gamma) * temp;
2331 cosx = cos(
alpha - gamma) * temp;
2333 assert(cosx != 0 || sinx != 0);
2338 for (
size_t j = 1; j < peripheries; j++) {
2341 vertices[i + j * sides] = Q;
2343 if (outp > peripheries) {
2347 vertices[i + peripheries * sides] = Q;
2350 for (i = 0; i < sides; i++) {
2351 pointf P = vertices[i + (peripheries - 1) * sides];
2352 bb = (
pointf){.
x = fmax(2.0 * fabs(P.
x), bb.x),
2353 .y = fmax(2.0 * fabs(P.
y), bb.y)};
2354 Q = vertices[i + (outp - 1) * sides];
2355 outline_bb = (
pointf){.
x = fmax(2.0 * fabs(Q.
x), outline_bb.x),
2356 .y = fmax(2.0 * fabs(Q.
y), outline_bb.y)};
2360 poly->regular = regular;
2361 poly->peripheries = peripheries;
2362 poly->sides = sides;
2363 poly->orientation = orientation;
2365 poly->distortion = distortion;
2366 poly->vertices = vertices;
2368 if (
poly->option.fixedshape) {
2410 if (!inside_context) {
2414 bp = inside_context->
s.
bp;
2415 n = inside_context->
s.
n;
2424 if (n != inside_context->
s.
lastn) {
2425 double n_width, n_height;
2426 double n_outline_width;
2427 double n_outline_height;
2432 double xsize, ysize;
2435 n_width = bb.
UR.
x - bb.
LL.
x;
2436 n_height = bb.
UR.
y - bb.
LL.
y;
2437 n_outline_width = n_width;
2438 n_outline_height = n_height;
2463 inside_context->
s.
scalex = n_width;
2465 inside_context->
s.
scalex /= xsize;
2466 inside_context->
s.
scaley = n_height;
2468 inside_context->
s.
scaley /= ysize;
2469 inside_context->
s.
box_URx = n_outline_width / 2;
2470 inside_context->
s.
box_URy = n_outline_height / 2;
2476 inside_context->
s.
outp =
2479 inside_context->
s.
outp = 0;
2482 inside_context->
s.
outp =
2485 inside_context->
s.
lastn = n;
2496 if (fabs(P.
x) > inside_context->
s.
box_URx ||
2502 return hypot(P.
x / inside_context->
s.
box_URx,
2506 size_t i = inside_context->
s.
last % sides;
2507 size_t i1 = (i + 1) % sides;
2516 for (
size_t j = 1; j < sides; j++) {
2519 i1 = (i + 1) % sides;
2522 i = (i + sides - 1) % sides;
2526 inside_context->
s.
last = i;
2531 inside_context->
s.
last = i;
2613 angle -=
M_PI * 0.5;
2617 angle = -0.5 *
M_PI;
2618 else if (angle ==
M_PI * 0.75)
2619 angle = -0.25 *
M_PI;
2620 else if (angle ==
M_PI * 0.5)
2622 else if (angle == 0)
2624 else if (angle ==
M_PI * -0.25)
2625 angle =
M_PI * 0.75;
2626 else if (angle ==
M_PI * -0.5)
2661 curve[0].
x = curve[0].
y = 0;
2662 curve[1] = curve[0];
2663 curve[3] = curve[2] = p;
2697 unsigned char sides,
inside_t * ictxt) {
2702 bool constrain =
false;
2704 unsigned char side = 0;
2728 maxv = fmax(b.
UR.
x, b.
UR.
y);
2731 if (compass && *compass) {
2732 switch (*compass++) {
2745 side = sides &
RIGHT;
2754 theta = -
M_PI * 0.5;
2763 theta = -
M_PI * 0.25;
2772 theta = -
M_PI * 0.75;
2800 side = sides &
LEFT;
2819 theta =
M_PI * 0.25;
2828 theta =
M_PI * 0.75;
2862 if (p.
x == 0 && p.
y == 0)
2866 double angle = atan2(p.
y, p.
x) + 1.5 *
M_PI;
2867 if (angle >= 2 *
M_PI)
2882 unsigned char sides;
2884 if (portname[0] ==
'\0')
2887 if (compass ==
NULL)
2893 "node %s, port %s, unrecognized compass point '%s' - ignored\n",
2916 return strchr(f,
':') !=
NULL;
2924 double xsize, ysize;
2931 char* fillcolor=
NULL;
2932 char* pencolor=
NULL;
2940 vertices =
poly->vertices;
2941 const size_t sides =
poly->sides;
2942 size_t peripheries =
poly->peripheries;
2953 char *clrs[2] = {0};
3011 if (peripheries == 0 && filled != 0 && pfilled) {
3018 for (j = 0; j < peripheries; j++) {
3019 for (
size_t i = 0; i < sides; i++) {
3020 P = vertices[i + j * sides];
3056 usershape_p =
false;
3059 if (
streq(name,
"custom")) {
3060 if ((name =
agget(n,
"shapefile")) && name[0])
3064 }
else if ((name =
agget(n,
"image")) && name[0]) {
3069 for (
size_t i = 0; i < sides; i++) {
3075 if (filled != 0 && pfilled) {
3128 size_t sides, outp, peripheries =
ND_shape(n)->polygon->peripheries;
3157 if (peripheries < 1)
3164 if (peripheries >= 1 &&
penwidth > 0) {
3170 P.
y = P.
x = sz / 2.;
3171 vertices[0].
x = -P.
x;
3172 vertices[0].
y = -P.
y;
3174 if (peripheries > 1) {
3175 for (j = 1, i = 2; j < peripheries; j++) {
3178 vertices[i].
x = -P.
x;
3179 vertices[i].
y = -P.
y;
3181 vertices[i].
x = P.
x;
3182 vertices[i].
y = P.
y;
3190 if (peripheries >= 1 &&
penwidth > 0 && outp > peripheries) {
3194 vertices[i].
x = -P.
x;
3195 vertices[i].
y = -P.
y;
3197 vertices[i].
x = P.
x;
3198 vertices[i].
y = P.
y;
3201 const double sz_outline = 2. * P.
x;
3203 poly->regular =
true;
3204 poly->peripheries = peripheries;
3206 poly->orientation = 0;
3208 poly->distortion = 0;
3209 poly->vertices = vertices;
3221 if (!inside_context) {
3225 n = inside_context->
s.
n;
3228 if (n != inside_context->
s.
lastn) {
3231 const size_t sides = 2;
3237 outp = sides * (
poly->peripheries + 1 - 1);
3238 }
else if (
poly->peripheries < 1) {
3242 outp = sides * (
poly->peripheries - 1);
3245 inside_context->
s.
radius =
poly->vertices[outp + 1].x;
3246 inside_context->
s.
lastn = n;
3250 if (fabs(P.
x) > inside_context->
s.
radius ||
3251 fabs(P.
y) > inside_context->
s.
radius)
3254 return hypot(P.
x, P.
y) <= inside_context->
s.
radius;
3272 vertices =
poly->vertices;
3273 const size_t sides =
poly->sides;
3274 size_t peripheries =
poly->peripheries;
3313 if (peripheries == 0) {
3319 for (
size_t j = 0; j < peripheries; j++) {
3321 pointf AF[A_size] = {{0}};
3322 for (
size_t i = 0; i < sides; i++) {
3323 P = vertices[i + j * sides];
3352 return c ==
'{' || c ==
'}' || c ==
'|' || c ==
'<' || c ==
'>';
3361 for (i = 0; i < f->
n_flds; i++) {
3382 char *tsp, *psp=
NULL, *hstsp, *hspsp=
NULL, *sp;
3383 char *tmpport =
NULL;
3390 for (maxf = 1,
cnt = 0, sp =
reclblp; *sp; sp++) {
3393 if (*sp && (*sp ==
'{' || *sp ==
'}' || *sp ==
'|' || *sp ==
'\\'))
3398 else if (*sp ==
'}')
3400 else if (*sp ==
'|' &&
cnt == 0)
3411 bool ishardspace =
false;
3413 if ((uc = *(
unsigned char*)
reclblp) && uc <
' ') {
3432 if (psp > text + 1 && psp - 1 != hspsp && *(psp - 1) ==
' ')
3463 if (tsp > text + 1 && tsp - 1 != hstsp && *(tsp - 1) ==
' ')
3504 if (!(*
reclblp ==
' ' && !ishardspace && *(tsp - 1) ==
' '
3510 if (!(*
reclblp ==
' ' && !ishardspace &&
3511 (psp == text || *(psp - 1) ==
' ')))
3517 while ((*
reclblp & 0xc0) == 0x80)
3530 double marginx, marginy;
3538 if (dimen.
x > 0.0 || dimen.
y > 0.0) {
3540 if ((p =
agget(n,
"margin"))) {
3541 i = sscanf(p,
"%lf,%lf", &marginx, &marginy);
3556 for (i = 0; i < f->
n_flds; i++) {
3560 d.
y = fmax(d.
y, d0.
y);
3563 d.
x = fmax(d.
x, d0.
x);
3584 if (f->
lp && !nojustify_p) {
3596 for (i = 0; i < f->
n_flds; i++) {
3598 amt = (int)((i + 1) * inc) - (
int)(i * inc);
3621 for (i = 0; i <=
last; i++) {
3629 }
else if (i ==
last)
3639 }
else if (i ==
last)
3654#if defined(DEBUG) && DEBUG > 1
3658 for (i = 0; i < l; i++)
3662static void prbox(
boxf b)
3664 fprintf(stderr,
"((%.5g,%.5g),(%.5g,%.5g))\n", b.
LL.
x, b.
LL.
y, b.
UR.
x,
3673 if (
info->n_flds == 0) {
3674 fprintf(stderr,
"Label \"%s\" ",
info->lp->text);
3677 fprintf(stderr,
"Tbl ");
3679 for (i = 0; i <
info->n_flds; i++) {
3680 dumpL(
info->fld[i], level + 1);
3715 if (sz.
x <
info->size.x || sz.
y <
info->size.y) {
3721 sz.
x = fmax(
info->size.x, sz.
x);
3722 sz.
y = fmax(
info->size.y, sz.
y);
3725 pointf ul = {-sz.
x / 2., sz.
y / 2.};
3761 unsigned char sides;
3763 if (portname[0] ==
'\0')
3766 if (compass ==
NULL)
3772 "node %s, port %s, unrecognized compass point '%s' - ignored\n",
3790 boxf *bp = inside_context->
s.
bp;
3830 for (i = 0; i <
info->n_flds; i++) {
3832 ls =
info->fld[i]->b.LL.x;
3833 rs =
info->fld[i]->b.UR.x;
3835 ls =
info->fld[i]->b.LL.y;
3836 rs =
info->fld[i]->b.UR.y;
3867 for (i = 0; i < f->
n_flds; i++) {
3908 char *clrs[2] = {0};
3983 p->
name = strdup(name);
4003 if (!
streq(name,
"custom")) {
4024 return P.
y >= -x2 && P.
y <= x2 && P.
x >= -
ND_lw(n) && P.
x <=
ND_rw(n);
4043 "%.5g %.5g translate newpath user_shape_%d\n",
4058#define alpha (M_PI/10.0)
4059#define alpha2 (2*alpha)
4060#define alpha3 (3*alpha)
4061#define alpha4 (2*alpha2)
4068 rx = sz0.
x/(2*cos(
alpha));
4070 const double r0 = fmax(rx, ry);
4083 double r, r0, theta =
alpha;
4090 else if (a < aspect) {
4101 for (i = 0; i < 10; i += 2) {
4102 vertices[i].
x = r*cos(theta);
4103 vertices[i].
y = r*sin(theta) -
offset;
4105 vertices[i+1].
x = r0*cos(theta);
4106 vertices[i+1].
y = r0*sin(theta) -
offset;
4119 if (!inside_context) {
4122 boxf *bp = inside_context->
s.
bp;
4135 if (n != inside_context->
s.
lastn) {
4147 inside_context->
s.
outp = 0;
4153 inside_context->
s.
lastn = n;
4160 for (
size_t i = 0; i < sides; i += 2) {
4162 R =
vertex[(i + 4) % sides + inside_context->
s.
outp];
4187 double yr = bb->
y/11;
4190 vertices[0].
y = y-yr;
4192 vertices[1].
y = y-(1-0.551784)*yr;
4193 vertices[2].
x = 0.551784*x;
4197 vertices[4].
x = -0.551784*x;
4200 vertices[5].
y = vertices[1].
y;
4202 vertices[6].
y = y-yr;
4203 vertices[7] = vertices[6];
4205 vertices[8].
y = yr-y;
4206 vertices[9] = vertices[8];
4207 vertices[10].
x = -x;
4208 vertices[10].
y = -vertices[1].
y;
4209 vertices[11].
x = vertices[4].
x;
4210 vertices[11].
y = -vertices[4].
y;
4211 vertices[12].
x = vertices[3].
x;
4212 vertices[12].
y = -vertices[3].
y;
4213 vertices[13].
x = vertices[2].
x;
4214 vertices[13].
y = -vertices[2].
y;
4215 vertices[14].
x = vertices[1].
x;
4216 vertices[14].
y = -vertices[1].
y;
4217 vertices[15].
x = vertices[0].
x;
4218 vertices[15].
y = -vertices[0].
y;
4219 vertices[16] = vertices[15];
4220 vertices[18] = vertices[17] = vertices[0];
4225 double y0 = AF[0].
y;
4228 vertices[0] = AF[0];
4229 vertices[1].
x = AF[1].
x;
4230 vertices[1].
y = y02 - AF[1].
y;
4231 vertices[2].
x = AF[2].
x;
4232 vertices[2].
y = y02 - AF[2].
y;
4233 vertices[3].
x = AF[3].
x;
4234 vertices[3].
y = y02 - AF[3].
y;
4235 vertices[4].
x = AF[4].
x;
4236 vertices[4].
y = y02 - AF[4].
y;
4237 vertices[5].
x = AF[5].
x;
4238 vertices[5].
y = y02 - AF[5].
y;
4239 vertices[6] = AF[6];
4289 int sides = oldport->
side;
4290 const char *rv =
NULL;
4312 for (
int i = 0; i < 4; i++) {
4313 if ((sides & (1 << i)) == 0)
4337 const double d =
DIST2(p, opt);
4338 if (!rv || d < mind) {
4349 const char *compass =
closestSide(n, other, oldport);
static agxbuf last
last message
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static char * gv_strdup(const char *original)
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
char * late_nnstring(void *obj, attrsym_t *attr, char *defaultValue)
bool mapbool(const char *p)
char * late_string(void *obj, attrsym_t *attr, char *defaultValue)
boxf polyBB(polygon_t *poly)
int late_int(void *obj, attrsym_t *attr, int defaultValue, int minimum)
double late_double(void *obj, attrsym_t *attr, double defaultValue, double minimum)
const char * safefile(const char *filename)
#define DEFAULT_SELECTEDFILLCOLOR
#define DEFAULT_NODEPENWIDTH
#define DEFAULT_ACTIVEFILLCOLOR
#define DEFAULT_DELETEDFILLCOLOR
#define DEFAULT_SELECTEDPENCOLOR
#define DEFAULT_VISITEDFILLCOLOR
#define DEFAULT_DELETEDPENCOLOR
#define DEFAULT_VISITEDPENCOLOR
#define DEFAULT_ACTIVEPENCOLOR
int stripedBox(GVJ_t *job, pointf *AF, const char *clrs, int rotate)
bool findStopColor(const char *colorlist, char *clrs[2], double *frac)
char ** parse_style(char *s)
int wedgedEllipse(GVJ_t *job, pointf *pf, const char *clrs)
boxf flip_rec_boxf(boxf b, pointf p)
pointf ccwrotatepf(pointf p, int ccwrot)
pointf cwrotatepf(pointf p, int cwrot)
#define PS2INCH(a_points)
#define INCH2PS(a_inches)
static pointf mid_pointf(pointf p, pointf q)
static pointf add_pointf(pointf p, pointf q)
static pointf sub_pointf(pointf p, pointf q)
static pointf interpolate_pointf(double t, pointf p, pointf q)
Agsym_t * N_gradientangle
static double len(glCompPoint p)
static int cnt(Dict_t *d, Dtlink_t **set)
char * agget(void *obj, char *name)
char * agxget(void *obj, Agsym_t *sym)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
int agerr(agerrlevel_t level, const char *fmt,...)
#define ND_outline_width(n)
#define ND_outline_height(n)
Agraph_t * agraphof(void *obj)
char * agnameof(void *)
returns a string descriptor for the object.
static void indent(int ix)
Arithmetic helper functions.
static bool is_exactly_zero(double v)
is a value precisely 0.0?
static bool is_exactly_equal(double a, double b)
are two values precisely the same?
swig_ptr_object_handlers offset
#define EMIT_CLUSTERS_LAST
static void color(Agraph_t *g)
void gvrender_beziercurve(GVJ_t *job, pointf *AF, size_t n, int filled)
void gvrender_usershape(GVJ_t *job, char *name, pointf *AF, size_t n, bool filled, char *imagescale, char *imagepos)
void gvrender_set_style(GVJ_t *job, char **s)
void gvrender_set_fillcolor(GVJ_t *job, char *name)
void gvrender_polyline(GVJ_t *job, pointf *AF, size_t n)
void gvrender_polygon(GVJ_t *job, pointf *af, size_t n, int filled)
point gvusershape_size(graph_t *g, char *name)
void gvrender_box(GVJ_t *job, boxf BF, int filled)
void gvrender_set_gradient_vals(GVJ_t *job, char *stopcolor, int angle, double frac)
void gvrender_ellipse(GVJ_t *job, pointf *AF, int filled)
void gvrender_begin_anchor(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
void gvrender_end_anchor(GVJ_t *job)
void gvrender_set_penwidth(GVJ_t *job, double penwidth)
void gvrender_set_pencolor(GVJ_t *job, char *name)
textitem scanner parser str
boxf * html_port(node_t *n, char *pname, unsigned char *sides)
textlabel_t * make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
void free_label(textlabel_t *p)
void emit_label(GVJ_t *job, emit_state_t emit_state, textlabel_t *lp)
static boxf bbox(Ppoly_t **obsp, int npoly, int *np)
NEATOPROCS_API void s1(graph_t *, node_t *)
void epsf_free(node_t *n)
void epsf_init(node_t *n)
void bezier_clip(inside_t *inside_context, bool(*insidefn)(inside_t *inside_context, pointf p), pointf *sp, bool left_inside)
static field_t * parse_error(field_t *rv, char *portname)
static polygon_t p_terminator
static polygon_t p_larrow
static char ** checkStyle(node_t *n, graphviz_polygon_style_t *flagp)
static polygon_t p_proteasesite
static bool poly_inside(inside_t *inside_context, pointf p)
static polygon_t p_triangle
static char * findFillDflt(node_t *n, char *dflt)
static double quant(double val, double q)
static bool IS_BOX(node_t *n)
static polygon_t p_proteinstab
static void record_init(node_t *n)
static pointf cylinder_size(pointf)
static poly_desc_t star_gen
static void record_gencode(GVJ_t *job, node_t *n)
static shape_desc * user_shape(char *name)
static pointf star_size(pointf)
static bool point_inside(inside_t *inside_context, pointf p)
static void poly_gencode(GVJ_t *job, node_t *n)
static shape_desc Shapes[]
static polygon_t p_parallelogram
static polygon_t p_Mcircle
static polygon_t p_doublecircle
static polygon_t p_insulator
static int record_path(node_t *n, port *p, int side, boxf rv[], int *kptr)
static polygon_t p_rnastab
static shape_functions poly_fns
static shape_functions star_fns
static graphviz_polygon_style_t style_or(graphviz_polygon_style_t a, graphviz_polygon_style_t b)
bitwise-OR styles
static polygon_t p_diamond
void resolvePorts(edge_t *e)
static bool epsf_inside(inside_t *inside_context, pointf p)
static const char * side_port[]
static polygon_t p_signature
static bool SPECIAL_CORNERS(graphviz_polygon_style_t style)
True if style requires processing through round_corners.
static bool star_inside(inside_t *inside_context, pointf p)
bool isPolygon(node_t *n)
static void point_init(node_t *n)
static field_t * parse_reclbl(node_t *n, bool LR, bool flag, char *text)
static size_t N_UserShape
static polygon_t p_tripleoctagon
static bool record_inside(inside_t *inside_context, pointf p)
static double userSize(node_t *n)
static polygon_t p_rarrow
void round_corners(GVJ_t *job, pointf *AF, size_t sides, graphviz_polygon_style_t style, int filled)
Handle some special graphical cases, such as rounding the shape, adding diagonals at corners,...
static port record_port(node_t *n, char *portname, char *)
static graphviz_polygon_style_t stylenode(GVJ_t *job, node_t *n)
static void star_vertices(pointf *, pointf *)
static void cylinder_vertices(pointf *, pointf *)
static polygon_t p_plaintext
static polygon_t p_cylinder
static shape_functions point_fns
static polygon_t p_trapezium
static polygon_t p_invtriangle
shape_kind shapeOf(node_t *n)
static int same_side(pointf p0, pointf p1, pointf L0, pointf L1)
static pointf * alloc_interpolation_points(pointf *AF, size_t sides, graphviz_polygon_style_t style, bool rounded)
static polygon_t p_Msquare
static char * findFill(node_t *n)
static bool isBox(node_t *n)
static polygon_t p_lpromoter
static field_t * map_rec_port(field_t *f, char *str)
static void rounded_draw(GVJ_t *job, pointf *AF, size_t sides, graphviz_polygon_style_t style, int filled)
draws rounded polygons with Bézier curve
static double invflip_angle(double angle, int rankdir)
static polygon_t p_invtrapezium
static void resize_reclbl(field_t *f, pointf sz, bool nojustify_p)
static polygon_t p_pentagon
static char * point_style[3]
static polygon_t p_restrictionsite
static int poly_path(node_t *n, port *p, int side, boxf rv[], int *kptr)
static polygon_t p_octagon
static pointf size_reclbl(node_t *n, field_t *f)
static polygon_t p_septagon
static char * penColor(GVJ_t *job, node_t *n)
static polygon_t p_polygon
shape_desc * bind_shape(char *name, node_t *np)
static polygon_t p_assembly
static pointf compassPoint(inside_t *ictxt, double y, double x)
static void epsf_gencode(GVJ_t *job, node_t *n)
static polygon_t p_rpromoter
static void diagonals_draw(GVJ_t *job, pointf *AF, size_t sides, graphviz_polygon_style_t style, int filled)
draws polygons with diagonals on corners
static polygon_t p_ribosite
static void gen_fields(GVJ_t *job, node_t *n, field_t *f)
static bool isEllipse(node_t *n)
static polygon_t p_square
static shape_desc ** UserShape
static const char * closestSide(node_t *n, node_t *other, port *oldport)
static polygon_t p_fivepoverhang
shape_desc * find_user_shape(const char *name)
static polygon_t p_component
static unsigned char invflip_side(unsigned char side, int rankdir)
static int compassPort(node_t *n, boxf *bp, port *pp, const char *compass, unsigned char sides, inside_t *ictxt)
static polygon_t p_invhouse
static polygon_t p_threepoverhang
static bool multicolor(const char *f)
static bool ISCTRL(int c)
static double mid_x(const pointf line[2])
X coordinate of line midpoint.
static polygon_t p_doubleoctagon
static bool IS_PLAIN(node_t *n)
static void record_free(node_t *n)
static void free_field(field_t *f)
static void poly_init(node_t *n)
static shape_functions record_fns
static void point_gencode(GVJ_t *job, node_t *n)
port resolvePort(node_t *n, node_t *other, port *oldport)
static shape_functions epsf_fns
static void pos_reclbl(field_t *f, pointf ul, unsigned char sides)
static polygon_t p_underline
static polygon_t p_promoter
static polygon_t p_noverhang
static void cylinder_draw(GVJ_t *job, pointf *AF, size_t sides, int filled)
static void poly_free(node_t *n)
static port poly_port(node_t *n, char *portname, char *)
static polygon_t p_hexagon
static polygon_t p_primersite
static polygon_t p_Mdiamond
static void unrecognized(node_t *n, char *p)
static poly_desc_t cylinder_gen
static polygon_t p_circle
static pointf cvtPt(pointf p, int rankdir)
static double mid_y(const pointf line[2])
Y coordinate of line midpoint.
static void Mcircle_hack(GVJ_t *job, node_t *n)
static polygon_t p_folder
static polygon_t p_ellipse
static shape_functions cylinder_fns
static bool streq(const char *a, const char *b)
are a and b equal?
unsigned explicit_tooltip
pointf(* size_gen)(pointf)
void(* vertex_gen)(pointf *, pointf *)
size_t sides
number of sides
graphviz_polygon_style_t option
ROUNDED, DIAGONAL corners, etc.
size_t peripheries
number of periphery lines
#define GUI_STATE_SELECTED
#define GUI_STATE_DELETED
#define GUI_STATE_VISITED
double radius
last radius seen
polygon_t * last_poly
last seen polygon
node_t * lastn
last node argument
size_t last
last used polygon vertex
double box_URy
various computed sizes of aspects of the last seen polygon
size_t outp
last used outline periphery