37#define ATTR_SET(a,n) ((a) && (*(agxget(n,a->index)) != '\0'))
44#define MIN_POINT 0.0003
123 .
peripheries = 1, .sides = 4, .option = {.underline =
true}};
131 .
regular =
true, .peripheries = 2, .sides = 1};
133 .
peripheries = 1, .sides = 3, .orientation = 180.0};
135 .
peripheries = 1, .sides = 4, .orientation = 180.0, .distortion = -0.4};
137 .
peripheries = 1, .sides = 5, .orientation = 180.0, .distortion = -0.64};
144 .option = {.diagonals =
true, .auxlabels =
true}};
148 .option = {.diagonals =
true}};
152 .option = {.diagonals =
true, .auxlabels =
true}};
364static double quant(
double val,
double q)
366 return ceil(val / q) * q;
378 c = a * L0.
x + b * L0.
y;
380 s0 = a * p0.
x + b * p0.
y - c >= 0;
381 s1 = a * p1.
x + b * p1.
y - c >= 0;
433 return p->
sides <= 2;
475 if (
streq(p,
"filled")) {
478 }
else if (
streq(p,
"rounded")) {
485 }
else if (
streq(p,
"diagonals")) {
492 }
else if (
streq(p,
"invis")) {
495 }
else if (
streq(p,
"radial")) {
556 AF[1].
x = AF[0].
x - 2 * p.
x;
575 for (
size_t seg = 0; seg < sides; seg++) {
583 const double d = hypot(
dx,
dy);
584 rbconst = fmin(rbconst, d / 3.0);
586 for (
size_t seg = 0; seg < sides; seg++) {
594 const double d = hypot(
dx,
dy);
627 for (
size_t seg = 0; seg < sides; seg++) {
628 pointf C[] = {
B[3 * seg + 2],
B[3 * seg + 4]};
647 for (
size_t seg = 0; seg < sides; seg++) {
648 pts[i++] =
B[4 * seg];
649 pts[i++] =
B[4 * seg + 1];
650 pts[i++] =
B[4 * seg + 1];
651 pts[i++] =
B[4 * seg + 2];
652 pts[i++] =
B[4 * seg + 2];
653 pts[i++] =
B[4 * seg + 3];
685 return (line[0].x + line[1].x) / 2;
694 return (line[0].y + line[1].y) / 2;
721 else if (style.
shape != 0)
733 switch (
mode.shape) {
737 for (
size_t seg = 1; seg < sides; seg++)
739 D[0] =
B[3 * (sides - 1) + 4];
740 D[sides] =
B[3 * (sides - 1) + 2];
745 const size_t sseg = sides - 1;
746 C[0] =
B[3 * sseg + 2];
747 C[1] =
B[3 * sseg + 4];
748 C[2].x =
C[1].x + (
C[0].x -
B[3 * sseg + 3].x);
749 C[2].y =
C[1].y + (
C[0].y -
B[3 * sseg + 3].y);
772 D[2].
x =
B[2].x + (
B[3].x -
B[4].x) / 3;
773 D[2].y =
B[2].y + (
B[3].y -
B[4].y) / 3;
774 D[3].x =
B[3].x + (
B[3].x -
B[4].x) / 3;
775 D[3].y =
B[3].y + (
B[3].y -
B[4].y) / 3;
776 for (
size_t seg = 4; seg < sides + 2; seg++)
777 D[seg] = AF[seg - 2];
804 D[1].
x = AF[0].
x - (AF[0].
x -
B[1].x) / 4;
805 D[1].y = AF[0].
y + (
B[3].y -
B[4].y) / 3;
806 D[2].x = AF[0].
x - 2 * (AF[0].
x -
B[1].x);
808 D[3].x = AF[0].
x - 2.25 * (AF[0].
x -
B[1].x);
812 for (
size_t seg = 4; seg < sides + 3; seg++)
813 D[seg] = AF[seg - 3];
831 C[0].x =
B[1].x + (
B[11].x -
B[0].x);
832 C[0].y =
B[1].y + (
B[11].y -
B[0].y);
861 D[2].
x =
B[3].x + (
B[4].x -
B[3].x);
862 D[2].y =
B[3].y + (
B[4].y -
B[3].y);
863 D[3].x =
D[2].x + (
B[3].x -
B[2].x);
864 D[3].y =
D[2].y + (
B[3].y -
B[2].y);
865 D[4].x =
D[3].x + (
B[4].x -
B[3].x);
866 D[4].y =
D[3].y + (
B[4].y -
B[3].y);
867 D[5].x =
D[4].x + (
D[2].x -
D[3].x);
868 D[5].y =
D[4].y + (
D[2].y -
D[3].y);
870 D[9].x =
B[6].x + (
B[5].x -
B[6].x);
871 D[9].y =
B[6].y + (
B[5].y -
B[6].y);
872 D[8].x =
D[9].x + (
B[6].x -
B[7].x);
873 D[8].y =
D[9].y + (
B[6].y -
B[7].y);
874 D[7].x =
D[8].x + (
B[5].x -
B[6].x);
875 D[7].y =
D[8].y + (
B[5].y -
B[6].y);
876 D[6].x =
D[7].x + (
D[9].x -
D[8].x);
877 D[6].y =
D[7].y + (
D[9].y -
D[8].y);
885 C[1].x =
D[2].x - (
D[3].x -
D[2].x);
886 C[1].y =
D[2].y - (
D[3].y -
D[2].y);
887 C[2].x =
C[1].x + (
D[4].x -
D[3].x);
888 C[2].y =
C[1].y + (
D[4].y -
D[3].y);
892 C[1].x =
D[6].x - (
D[7].x -
D[6].x);
893 C[1].y =
D[6].y - (
D[7].y -
D[6].y);
894 C[2].x =
C[1].x + (
D[8].x -
D[7].x);
895 C[2].y =
C[1].y + (
D[8].y -
D[7].y);
923 D[0].x =
mid_x(AF) + (AF[0].
x - AF[1].
x)/8;
924 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)*3/2;
925 D[1].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/4;
929 D[3].x =
D[2].x + (
B[2].x -
B[3].x)/2;
932 D[4].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y);
936 D[6].y =
D[4].y - (
B[3].y-
B[4].y)/4;
937 D[7].x =
D[6].x + (
B[2].x -
B[3].x);
938 D[7].y =
D[6].y + (
B[3].y -
B[4].y)/2;
940 D[8].y =
D[0].y + (
B[3].y -
B[4].y)/4;
947 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
970 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
972 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
974 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
976 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
977 D[4].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1002 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1005 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1006 D[2].x =
D[1].x + (
B[2].x-
B[3].x)/2;
1009 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/2;
1010 D[4].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1014 D[6].x =
mid_x(AF) - (
B[2].x-
B[3].x)/4;
1024 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1047 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1050 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/4;
1051 D[2].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1052 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1053 D[3].x =
mid_x(AF) - (
B[2].x-
B[3].x)/4;
1055 D[4].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1065 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1088 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x);
1089 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1090 D[1].x =
D[0].x - (
B[2].x-
B[3].x);
1091 D[1].y =
D[0].y + (
B[3].y-
B[4].y);
1093 D[2].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1094 D[3].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/4;
1104 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1127 D[0].x =
mid_x(AF) + (AF[0].
x - AF[1].
x)/8 + (
B[2].x-
B[3].x)/2;
1128 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1129 D[1].x =
mid_x(AF) - (AF[0].
x - AF[1].
x)/8;
1132 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1133 D[3].x =
D[2].x - (
B[2].x-
B[3].x)/2;
1136 D[4].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)/4;
1137 D[5].x =
D[0].x - (
B[2].x-
B[3].x)/2;
1140 D[6].y =
D[5].y - (
B[3].y-
B[4].y)/2;
1149 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1156 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1180 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1181 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1184 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1192 D[0].x = AF[1].
x + (
B[2].x-
B[3].x);
1193 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1194 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1197 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1206 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1230 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1232 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1233 D[2].x =
D[1].x - 2*(
B[3].y-
B[4].y);
1242 D[0].x = AF[0].
x - (
B[2].x-
B[3].x);
1243 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1245 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/2;
1246 D[2].x =
D[1].x - (
B[3].y-
B[4].y);
1256 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1281 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1282 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1283 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1286 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1294 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1295 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1296 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1299 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1307 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1308 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1309 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1312 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1320 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1321 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1322 D[1].x =
D[0].x + (
B[2].x-
B[3].x);
1325 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1334 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1338 C[0].x =
mid_x(AF) - (
B[2].x-
B[3].x)*9/8;
1341 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1363 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x);
1364 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1365 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1368 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1376 D[0].x =
mid_x(AF) - (
B[2].x-
B[3].x);
1377 D[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)*5/8;
1378 D[1].x =
D[0].x + 2*(
B[2].x-
B[3].x);
1381 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/2;
1390 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1397 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1417 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1419 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1421 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1423 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1427 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1428 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/8;
1429 C[1].x =
C[0].x + (
B[2].x-
B[3].x)/4;
1430 C[1].y =
C[0].y - (
B[3].y-
B[4].y)/4;
1434 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1435 C[0].y =
mid_y(&AF[1]) - (
B[3].y-
B[4].y)/8;
1436 C[1].x =
C[0].x + (
B[2].x-
B[3].x)/4;
1437 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/4;
1441 C[0].x = AF[1].
x + (
B[2].x-
B[3].x)/4;
1442 C[0].y = AF[2].
y + (
B[3].y-
B[4].y)*3/4;
1443 C[1].x = AF[0].
x - (
B[2].x-
B[3].x)/4;
1461 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/2;
1462 D[0].y =
mid_y(&AF[1]) + (
B[2].x-
B[3].x)/2;
1464 D[1].y =
mid_y(&AF[1]) - (
B[2].x-
B[3].x)/2;
1465 D[2].x =
mid_x(AF) - (
B[2].x-
B[3].x)/2;
1473 C[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1474 C[0].y =
mid_y(&AF[1]) + (
B[2].x-
B[3].x)*3/4;
1476 C[1].y =
mid_y(&AF[1]) - (
B[2].x-
B[3].x)*3/4;
1477 C[2].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1485 C[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)*3/4;
1488 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1494 C[1].x =
mid_x(AF) - (
B[2].x-
B[3].x)*3/4;
1495 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1511 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1512 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1514 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1515 D[2].x =
D[0].x - (
B[2].x-
B[3].x)/8;
1516 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/8;
1518 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1520 D[4].y =
D[3].y + (
B[3].y-
B[4].y)/8;
1525 D[7].x =
D[6].x - (
B[2].x-
B[3].x)/8;
1527 D[8].x =
D[7].x - (
B[2].x-
B[3].x)/8;
1531 D[10].x =
D[8].x + (
B[2].x-
B[3].x)/8;
1551 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1556 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1558 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1565 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1582 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1583 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1584 D[1].x =
D[0].x + (
B[2].x-
B[3].x)/8;
1585 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1587 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/4;
1589 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1590 D[4].x =
D[3].x - (
B[2].x-
B[3].x)/4;
1592 D[5].x =
D[4].x - (
B[2].x-
B[3].x)/8;
1606 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1611 C[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/4;
1613 C[1].y =
C[0].y + (
B[3].y-
B[4].y)/8;
1622 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1638 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/4;
1639 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1641 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1642 D[2].x =
D[0].x - (
B[2].x-
B[3].x)/8;
1643 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/8;
1645 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1647 D[4].y =
D[3].y + (
B[3].y-
B[4].y)/8;
1652 D[7].x =
D[6].x - (
B[2].x-
B[3].x)/8;
1654 D[8].x =
D[7].x - (
B[2].x-
B[3].x)/8;
1658 D[10].x =
D[8].x + (
B[2].x-
B[3].x)/8;
1683 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1700 D[0].x =
mid_x(AF) + (
B[2].x-
B[3].x)/8;
1701 D[0].y =
mid_y(&AF[1]) + (
B[3].y-
B[4].y)/2;
1702 D[1].x =
D[0].x + (
B[2].x-
B[3].x)/8;
1703 D[1].y =
D[0].y + (
B[3].y-
B[4].y)/8;
1705 D[2].y =
D[1].y + (
B[3].y-
B[4].y)/4;
1707 D[3].y =
D[2].y + (
B[3].y-
B[4].y)/8;
1708 D[4].x =
D[3].x - (
B[2].x-
B[3].x)/4;
1710 D[5].x =
D[4].x - (
B[2].x-
B[3].x)/8;
1729 C[1].y = AF[2].
y + (AF[0].
y - AF[3].
y)/2;
1752 D[0].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1753 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1755 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1758 D[3].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1760 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1761 D[4].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1762 D[5].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1763 D[5].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1764 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1766 D[7].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1769 D[8].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1792 D[0].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1793 D[0].y =
B[1].y - (
B[3].y -
B[4].y)/2;
1795 D[1].y =
B[3].y - (
B[3].y -
B[4].y)/2;
1797 D[2].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1798 D[3].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1799 D[3].y = AF[2].
y + (
B[3].y -
B[4].y)/2;
1800 D[4].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1802 D[5].y = AF[0].
y - (AF[0].
y - AF[3].
y)/2;
1805 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1827 D[0].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1828 D[1].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1829 D[1].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1830 D[2].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1833 D[3].y = AF[1].
y - (AF[1].
y - AF[2].
y)/2;
1834 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1836 D[5].y = AF[2].
y + (
B[3].y-
B[4].y)/2;
1837 D[5].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1838 D[6].y = AF[3].
y + (
B[3].y -
B[4].y)/2;
1863 D[0].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1864 D[1].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1865 D[1].y = AF[0].
y - (
B[3].y-
B[4].y)/2;
1866 D[2].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1869 D[3].y = AF[1].
y - (AF[1].
y - AF[2].
y)/2;
1870 D[4].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1872 D[5].y = AF[2].
y + (
B[3].y-
B[4].y)/2;
1873 D[5].x =
B[2].x + (
B[2].x -
B[3].x)/2;
1874 D[6].y = AF[3].
y + (
B[3].y -
B[4].y)/2;
1875 D[6].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1876 D[7].x =
B[1].x - (
B[2].x -
B[3].x)/2;
1933 char *p, *sfile, *fxd;
1934 double temp,
alpha, beta, gamma;
1935 double orientation, distortion, skew;
1936 double scalex, scaley;
1937 double width, height, marginx, marginy, spacex;
1941 bool regular = !!
ND_shape(n)->polygon->regular;
1942 size_t peripheries =
ND_shape(n)->polygon->peripheries;
1943 size_t sides =
ND_shape(n)->polygon->sides;
1944 orientation =
ND_shape(n)->polygon->orientation;
1946 distortion =
ND_shape(n)->polygon->distortion;
1962 width = height = sz;
1966 width = height =
INCH2PS(fmin(width, height));
1985 if (dimen.
x > 0 || dimen.
y > 0) {
1988 if ((p =
agget(n,
"margin"))) {
1989 marginx = marginy = 0;
1990 const int i = sscanf(p,
"%lf,%lf", &marginx, &marginy);
1991 marginx = fmax(marginx, 0);
1992 marginy = fmax(marginy, 0);
2005 spacex = dimen.
x -
ND_label(n)->dimen.x;
2010 dimen.
x =
quant(dimen.
x, temp);
2011 dimen.
y =
quant(dimen.
y, temp);
2014 imagesize.
x = imagesize.
y = 0;
2021 sfile =
agget(n,
"shapefile");
2023 if (imagesize.
x == -1 && imagesize.
y == -1) {
2025 "No or improper shapefile=\"%s\" for node \"%s\"\n",
2026 sfile ? sfile :
"<nil>",
agnameof(n));
2027 imagesize.
x = imagesize.
y = 0;
2034 }
else if ((sfile =
agget(n,
"image")) && *sfile !=
'\0') {
2036 if (imagesize.
x == -1 && imagesize.
y == -1) {
2038 "No or improper image=\"%s\" for node \"%s\"\n",
2039 sfile ? sfile :
"<nil>",
agnameof(n));
2040 imagesize.
x = imagesize.
y = 0;
2049 pointf bb = {.
x = fmax(dimen.
x, imagesize.
x),
2050 .y = fmax(dimen.
y, imagesize.
y)};
2060 p =
agget(n,
"labelloc");
2061 if (p && (p[0] ==
't' || p[0] ==
'b'))
2066 const bool isBox = sides == 4 && fabs(fmod(orientation, 90)) < 0.5
2079 if (height > temp &&
ND_label(n)->valign ==
'c') {
2083 bb.
x *= sqrt(1. / (1. -
SQR(bb.
y / height)));
2090 temp = cos(
M_PI / (
double)sides);
2104 if (*fxd ==
's' &&
streq(fxd,
"shape")) {
2105 bb = (
pointf){.
x = width, .y = height};
2106 poly->option.fixedshape =
true;
2111 "node '%s', graph '%s' size too small for label\n",
2113 bb = (
pointf){.
x = width, .y = height};
2115 bb.
x = width = fmax(width, bb.
x);
2116 bb.
y = height = fmax(height, bb.
y);
2123 width = height = bb.
x = bb.
y = fmax(bb.
x, bb.
y);
2129 ND_label(n)->space.x = fmax(dimen.
x, bb.
x) - spacex;
2131 else if (dimen.
y < bb.
y) {
2132 temp = bb.
x * sqrt(1.0 -
SQR(dimen.
y) /
SQR(bb.
y));
2133 ND_label(n)->space.x = fmax(dimen.
x, temp) - spacex;
2136 ND_label(n)->space.x = dimen.
x - spacex;
2138 ND_label(n)->space.x = dimen.
x - spacex;
2141 if (!
poly->option.fixedshape) {
2142 temp = bb.
y - min_bb.
y;
2143 if (dimen.
y < imagesize.
y)
2144 temp += imagesize.
y - dimen.
y;
2150 size_t outp = peripheries;
2151 if (peripheries < 1)
2154 if (peripheries >= 1 &&
penwidth > 0) {
2163 pointf P = {.
x = bb.
x / 2., .y = bb.
y / 2.};
2164 vertices[0] = (
pointf){.
x = -P.
x, .y = -P.
y};
2166 if (peripheries > 1) {
2167 for (
size_t j = 1, i = 2; j < peripheries; j++) {
2170 vertices[i] = (
pointf){.
x = -P.
x, .y = -P.
y};
2179 if (outp > peripheries) {
2183 size_t i = sides * peripheries;
2184 vertices[i] = (
pointf){.
x = -P.
x, .y = -P.
y};
2188 outline_bb.
x = 2. * P.
x;
2189 outline_bb.
y = 2. * P.
y;
2206 double sinx = 0, cosx = 0,
xmax,
ymax;
2214 double angle, sectorangle, sidelength, skewdist, gdistortion, gskew;
2215 sectorangle = 2. *
M_PI / (double)sides;
2216 sidelength = sin(sectorangle / 2.);
2217 skewdist = hypot(fabs(distortion) + fabs(skew), 1.);
2218 gdistortion = distortion *
SQRT2 / cos(sectorangle / 2.);
2220 angle = (sectorangle -
M_PI) / 2.;
2223 pointf R = {.
x = .5 * cosx, .y = .5 * sinx};
2225 angle += (
M_PI - sectorangle) / 2.;
2226 for (
size_t i = 0; i < sides; i++) {
2229 angle += sectorangle;
2232 R.
x += sidelength * cosx;
2233 R.
y += sidelength * sinx;
2237 .
x = R.
x * (skewdist + R.
y * gdistortion) + R.
y * gskew,
2244 P.
x = P.
y = hypot(P.
x, P.
y);
2259 vertices[1] = (
pointf){.
x = -P.
x, .y = P.
y};
2260 vertices[2] = (
pointf){.
x = -P.
x, .y = -P.
y};
2261 vertices[3] = (
pointf){.
x = P.
x, .y = -P.
y};
2273 scalex = bb.
x /
xmax;
2274 scaley = bb.
y /
ymax;
2277 for (i = 0; i < sides; i++) {
2287 for (
size_t j = 1; j < sides; j++) {
2288 Q = vertices[(i - j) % sides];
2294 beta = atan2(R.
y - Q.
y, R.
x - Q.
x);
2296 for (i = 0; i < sides; i++) {
2309 for (
size_t j = 1; j < sides; j++) {
2310 R = vertices[(i + j) % sides];
2317 beta = atan2(R.
y - Q.
y, R.
x - Q.
x);
2322 temp =
GAP / sin(gamma);
2325 sinx = sin(
alpha - gamma) * temp;
2326 cosx = cos(
alpha - gamma) * temp;
2328 assert(cosx != 0 || sinx != 0);
2333 for (
size_t j = 1; j < peripheries; j++) {
2336 vertices[i + j * sides] = Q;
2338 if (outp > peripheries) {
2342 vertices[i + peripheries * sides] = Q;
2345 for (i = 0; i < sides; i++) {
2346 pointf P = vertices[i + (peripheries - 1) * sides];
2347 bb = (
pointf){.
x = fmax(2.0 * fabs(P.
x), bb.x),
2348 .y = fmax(2.0 * fabs(P.
y), bb.y)};
2349 Q = vertices[i + (outp - 1) * sides];
2350 outline_bb = (
pointf){.
x = fmax(2.0 * fabs(Q.
x), outline_bb.x),
2351 .y = fmax(2.0 * fabs(Q.
y), outline_bb.y)};
2355 poly->regular = regular;
2356 poly->peripheries = peripheries;
2357 poly->sides = sides;
2358 poly->orientation = orientation;
2360 poly->distortion = distortion;
2361 poly->vertices = vertices;
2363 if (
poly->option.fixedshape) {
2405 if (!inside_context) {
2409 bp = inside_context->
s.
bp;
2410 n = inside_context->
s.
n;
2419 if (n != inside_context->
s.
lastn) {
2420 double n_width, n_height;
2421 double n_outline_width;
2422 double n_outline_height;
2427 double xsize, ysize;
2430 n_width = bb.
UR.
x - bb.
LL.
x;
2431 n_height = bb.
UR.
y - bb.
LL.
y;
2432 n_outline_width = n_width;
2433 n_outline_height = n_height;
2458 inside_context->
s.
scalex = n_width;
2460 inside_context->
s.
scalex /= xsize;
2461 inside_context->
s.
scaley = n_height;
2463 inside_context->
s.
scaley /= ysize;
2464 inside_context->
s.
box_URx = n_outline_width / 2;
2465 inside_context->
s.
box_URy = n_outline_height / 2;
2470 inside_context->
s.
outp =
2473 inside_context->
s.
outp = 0;
2476 inside_context->
s.
outp =
2479 inside_context->
s.
lastn = n;
2490 if (fabs(P.
x) > inside_context->
s.
box_URx ||
2496 return hypot(P.
x / inside_context->
s.
box_URx,
2500 size_t i = inside_context->
s.
last % sides;
2501 size_t i1 = (i + 1) % sides;
2510 for (
size_t j = 1; j < sides; j++) {
2513 i1 = (i + 1) % sides;
2516 i = (i + sides - 1) % sides;
2520 inside_context->
s.
last = i;
2525 inside_context->
s.
last = i;
2607 angle -=
M_PI * 0.5;
2611 angle = -0.5 *
M_PI;
2612 else if (angle ==
M_PI * 0.75)
2613 angle = -0.25 *
M_PI;
2614 else if (angle ==
M_PI * 0.5)
2616 else if (angle == 0)
2618 else if (angle ==
M_PI * -0.25)
2619 angle =
M_PI * 0.75;
2620 else if (angle ==
M_PI * -0.5)
2655 curve[0].
x = curve[0].
y = 0;
2656 curve[1] = curve[0];
2657 curve[3] = curve[2] = p;
2691 unsigned char sides,
inside_t * ictxt) {
2696 bool constrain =
false;
2698 unsigned char side = 0;
2722 maxv = fmax(b.
UR.
x, b.
UR.
y);
2725 if (compass && *compass) {
2726 switch (*compass++) {
2739 side = sides &
RIGHT;
2748 theta = -
M_PI * 0.5;
2757 theta = -
M_PI * 0.25;
2766 theta = -
M_PI * 0.75;
2794 side = sides &
LEFT;
2813 theta =
M_PI * 0.25;
2822 theta =
M_PI * 0.75;
2856 if (p.
x == 0 && p.
y == 0)
2860 double angle = atan2(p.
y, p.
x) + 1.5 *
M_PI;
2861 if (angle >= 2 *
M_PI)
2876 unsigned char sides;
2878 if (portname[0] ==
'\0')
2881 if (compass ==
NULL)
2887 "node %s, port %s, unrecognized compass point '%s' - ignored\n",
2910 return strchr(f,
':') !=
NULL;
2918 double xsize, ysize;
2925 char* fillcolor=
NULL;
2926 char* pencolor=
NULL;
2935 vertices =
poly->vertices;
2936 const size_t sides =
poly->sides;
2937 size_t peripheries =
poly->peripheries;
3014 if (peripheries == 0 && filled != 0 && pfilled) {
3021 for (j = 0; j < peripheries; j++) {
3022 for (
size_t i = 0; i < sides; i++) {
3023 P = vertices[i + j * sides];
3059 usershape_p =
false;
3062 if (
streq(name,
"custom")) {
3063 if ((name =
agget(n,
"shapefile")) && name[0])
3067 }
else if ((name =
agget(n,
"image")) && name[0]) {
3072 for (
size_t i = 0; i < sides; i++) {
3078 if (filled != 0 && pfilled) {
3130 size_t sides, outp, peripheries =
ND_shape(n)->polygon->peripheries;
3138 static const double UNSET = -1.0;
3162 if (peripheries < 1)
3168 if (peripheries >= 1 &&
penwidth > 0) {
3174 P.
y = P.
x = sz / 2.;
3175 vertices[0].
x = -P.
x;
3176 vertices[0].
y = -P.
y;
3178 if (peripheries > 1) {
3179 for (j = 1, i = 2; j < peripheries; j++) {
3182 vertices[i].
x = -P.
x;
3183 vertices[i].
y = -P.
y;
3185 vertices[i].
x = P.
x;
3186 vertices[i].
y = P.
y;
3194 if (peripheries >= 1 &&
penwidth > 0 && outp > peripheries) {
3198 vertices[i].
x = -P.
x;
3199 vertices[i].
y = -P.
y;
3201 vertices[i].
x = P.
x;
3202 vertices[i].
y = P.
y;
3205 const double sz_outline = 2. * P.
x;
3207 poly->regular =
true;
3208 poly->peripheries = peripheries;
3210 poly->orientation = 0;
3212 poly->distortion = 0;
3213 poly->vertices = vertices;
3225 if (!inside_context) {
3229 n = inside_context->
s.
n;
3232 if (n != inside_context->
s.
lastn) {
3235 const size_t sides = 2;
3240 outp = sides * (
poly->peripheries + 1 - 1);
3241 }
else if (
poly->peripheries < 1) {
3245 outp = sides * (
poly->peripheries - 1);
3248 inside_context->
s.
radius =
poly->vertices[outp + 1].x;
3249 inside_context->
s.
lastn = n;
3253 if (fabs(P.
x) > inside_context->
s.
radius ||
3254 fabs(P.
y) > inside_context->
s.
radius)
3257 return hypot(P.
x, P.
y) <= inside_context->
s.
radius;
3275 vertices =
poly->vertices;
3276 const size_t sides =
poly->sides;
3277 size_t peripheries =
poly->peripheries;
3324 if (peripheries == 0) {
3330 for (
size_t j = 0; j < peripheries; j++) {
3332 pointf AF[A_size] = {{0}};
3333 for (
size_t i = 0; i < sides; i++) {
3334 P = vertices[i + j * sides];
3363 return c ==
'{' || c ==
'}' || c ==
'|' || c ==
'<' || c ==
'>';
3372 for (i = 0; i < f->
n_flds; i++) {
3393 char *tsp, *psp=
NULL, *hstsp, *hspsp=
NULL, *sp;
3394 char *tmpport =
NULL;
3401 for (maxf = 1,
cnt = 0, sp =
reclblp; *sp; sp++) {
3404 if (*sp && (*sp ==
'{' || *sp ==
'}' || *sp ==
'|' || *sp ==
'\\'))
3409 else if (*sp ==
'}')
3411 else if (*sp ==
'|' &&
cnt == 0)
3422 bool ishardspace =
false;
3424 if ((uc = *(
unsigned char*)
reclblp) && uc <
' ') {
3443 if (psp > text + 1 && psp - 1 != hspsp && *(psp - 1) ==
' ')
3474 if (tsp > text + 1 && tsp - 1 != hstsp && *(tsp - 1) ==
' ')
3480 lbl->fontsize,
lbl->fontname,
lbl->fontcolor);
3499 }
else if (*(
reclblp + 1) ==
' ' && !
lbl->html)
3515 if (!(*
reclblp ==
' ' && !ishardspace && *(tsp - 1) ==
' '
3521 if (!(*
reclblp ==
' ' && !ishardspace &&
3522 (psp == text || *(psp - 1) ==
' ')))
3528 while ((*
reclblp & 0xc0) == 0x80)
3541 double marginx, marginy;
3549 if (dimen.
x > 0.0 || dimen.
y > 0.0) {
3551 if ((p =
agget(n,
"margin"))) {
3552 i = sscanf(p,
"%lf,%lf", &marginx, &marginy);
3567 for (i = 0; i < f->
n_flds; i++) {
3571 d.
y = fmax(d.
y, d0.
y);
3574 d.
x = fmax(d.
x, d0.
x);
3595 if (f->
lp && !nojustify_p) {
3607 for (i = 0; i < f->
n_flds; i++) {
3609 amt = (int)((i + 1) * inc) - (
int)(i * inc);
3632 for (i = 0; i <=
last; i++) {
3640 }
else if (i ==
last)
3650 }
else if (i ==
last)
3665#if defined(DEBUG) && DEBUG > 1
3669 for (i = 0; i < l; i++)
3673static void prbox(
boxf b)
3675 fprintf(stderr,
"((%.5g,%.5g),(%.5g,%.5g))\n", b.
LL.
x, b.
LL.
y, b.
UR.
x,
3684 if (
info->n_flds == 0) {
3685 fprintf(stderr,
"Label \"%s\" ",
info->lp->text);
3688 fprintf(stderr,
"Tbl ");
3690 for (i = 0; i <
info->n_flds; i++) {
3691 dumpL(
info->fld[i], level + 1);
3726 if (sz.
x <
info->size.x || sz.
y <
info->size.y) {
3732 sz.
x = fmax(
info->size.x, sz.
x);
3733 sz.
y = fmax(
info->size.y, sz.
y);
3736 pointf ul = {-sz.
x / 2., sz.
y / 2.};
3772 unsigned char sides;
3774 if (portname[0] ==
'\0')
3777 if (compass ==
NULL)
3783 "node %s, port %s, unrecognized compass point '%s' - ignored\n",
3801 boxf *bp = inside_context->
s.
bp;
3840 for (i = 0; i <
info->n_flds; i++) {
3842 ls =
info->fld[i]->b.LL.x;
3843 rs =
info->fld[i]->b.UR.x;
3845 ls =
info->fld[i]->b.LL.y;
3846 rs =
info->fld[i]->b.UR.y;
3877 for (i = 0; i < f->
n_flds; i++) {
3993 p->
name = strdup(name);
4013 if (!
streq(name,
"custom")) {
4034 return P.
y >= -x2 && P.
y <= x2 && P.
x >= -
ND_lw(n) && P.
x <=
ND_rw(n);
4053 "%.5g %.5g translate newpath user_shape_%d\n",
4068#define alpha (M_PI/10.0)
4069#define alpha2 (2*alpha)
4070#define alpha3 (3*alpha)
4071#define alpha4 (2*alpha2)
4078 rx = sz0.
x/(2*cos(
alpha));
4080 const double r0 = fmax(rx, ry);
4093 double r, r0, theta =
alpha;
4100 else if (a < aspect) {
4111 for (i = 0; i < 10; i += 2) {
4112 vertices[i].
x = r*cos(theta);
4113 vertices[i].
y = r*sin(theta) -
offset;
4115 vertices[i+1].
x = r0*cos(theta);
4116 vertices[i+1].
y = r0*sin(theta) -
offset;
4129 if (!inside_context) {
4132 boxf *bp = inside_context->
s.
bp;
4145 if (n != inside_context->
s.
lastn) {
4156 inside_context->
s.
outp = 0;
4162 inside_context->
s.
lastn = n;
4169 for (
size_t i = 0; i < sides; i += 2) {
4171 R =
vertex[(i + 4) % sides + inside_context->
s.
outp];
4196 double yr = bb->
y/11;
4199 vertices[0].
y = y-yr;
4201 vertices[1].
y = y-(1-0.551784)*yr;
4202 vertices[2].
x = 0.551784*x;
4206 vertices[4].
x = -0.551784*x;
4209 vertices[5].
y = vertices[1].
y;
4211 vertices[6].
y = y-yr;
4212 vertices[7] = vertices[6];
4214 vertices[8].
y = yr-y;
4215 vertices[9] = vertices[8];
4216 vertices[10].
x = -x;
4217 vertices[10].
y = -vertices[1].
y;
4218 vertices[11].
x = vertices[4].
x;
4219 vertices[11].
y = -vertices[4].
y;
4220 vertices[12].
x = vertices[3].
x;
4221 vertices[12].
y = -vertices[3].
y;
4222 vertices[13].
x = vertices[2].
x;
4223 vertices[13].
y = -vertices[2].
y;
4224 vertices[14].
x = vertices[1].
x;
4225 vertices[14].
y = -vertices[1].
y;
4226 vertices[15].
x = vertices[0].
x;
4227 vertices[15].
y = -vertices[0].
y;
4228 vertices[16] = vertices[15];
4229 vertices[18] = vertices[17] = vertices[0];
4234 double y0 = AF[0].
y;
4237 vertices[0] = AF[0];
4238 vertices[1].
x = AF[1].
x;
4239 vertices[1].
y = y02 - AF[1].
y;
4240 vertices[2].
x = AF[2].
x;
4241 vertices[2].
y = y02 - AF[2].
y;
4242 vertices[3].
x = AF[3].
x;
4243 vertices[3].
y = y02 - AF[3].
y;
4244 vertices[4].
x = AF[4].
x;
4245 vertices[4].
y = y02 - AF[4].
y;
4246 vertices[5].
x = AF[5].
x;
4247 vertices[5].
y = y02 - AF[5].
y;
4248 vertices[6] = AF[6];
4298 int sides = oldport->
side;
4299 const char *rv =
NULL;
4321 for (
int i = 0; i < 4; i++) {
4322 if ((sides & (1 << i)) == 0)
4346 const double d =
DIST2(p, opt);
4347 if (!rv || d < mind) {
4358 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 wedgedEllipse(GVJ_t *job, pointf *pf, char *clrs)
int stripedBox(GVJ_t *job, pointf *AF, char *clrs, int rotate)
char ** parse_style(char *s)
bool findStopColor(char *colorlist, char *clrs[2], double *frac)
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_visitedfillcolor
Agsym_t * N_selectedfillcolor
Agsym_t * N_activefillcolor
Agsym_t * N_deletedfillcolor
Agsym_t * N_gradientangle
Agsym_t * N_activepencolor
Agsym_t * N_visitedpencolor
Agsym_t * N_deletedpencolor
Agsym_t * N_selectedpencolor
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)
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