40 ipp.
y = pp.
y + (int) ((ipp.
x - ppx) * (ppy - cpy) / (ppx - cpx));
41 if (ipp.
y >= ll.
y && ipp.
y <= ur.
y)
46 ipp.
y = pp.
y + (int) ((ipp.
x - ppx) * (ppy - cpy) / (ppx - cpx));
47 if (ipp.
y >= ll.
y && ipp.
y <= ur.
y)
52 ipp.
x = pp.
x + (int) ((ipp.
y - ppy) * (ppx - cpx) / (ppy - cpy));
53 if (ipp.
x >= ll.
x && ipp.
x <= ur.
x)
58 ipp.
x = pp.
x + (int) ((ipp.
y - ppy) * (ppx - cpx) / (ppy - cpy));
59 if (ipp.
x >= ll.
x && ipp.
x <= ur.
x)
65 "segment [(%.5g, %.5g),(%.5g,%.5g)] does not intersect box "
66 "ll=(%.5g,%.5g),ur=(%.5g,%.5g)\n", pp.
x, pp.
y, cp.
x, cp.
y, ll.
x, ll.
y,
89 if (!cluster_name || *cluster_name ==
'\0')
93 agwarningf(
"cluster named %s not found\n", cluster_name);
115 int num_crossings = 0;
120 for (i = 1; i <= 3; i++) {
123 if (
sign != old_sign && old_sign != 0)
126 return num_crossings;
137 int num_crossings = 0;
142 for (i = 1; i <= 3; i++) {
145 if (
sign != old_sign && old_sign != 0)
148 return num_crossings;
161 double xcoord,
double ymin,
double ymax)
176 if (no_cross == 1 && fabs(pts[3].x - xcoord) <= 0.005) {
177 if (
ymin <= pts[3].y && pts[3].y <=
ymax) {
184 Bezier(pts, 0.5, Left, Right);
203 double ycoord,
double xmin,
double xmax)
218 if (no_cross == 1 && fabs(pts[3].y - ycoord) <= 0.005) {
219 if (
xmin <= pts[3].x && pts[3].x <=
xmax) {
226 Bezier(pts, 0.5, Left, Right);
250 for (i = 0; i < 4; i++) {
255 if (t >= 0 && t < tmin) {
261 if (t >= 0 && t < tmin) {
267 if (t >= 0 && t < tmin) {
273 if (t >= 0 && t < tmin) {
292 size_t starti = 0, endi = 0;
302 if (
ED_spl(e)->size > 1) {
303 agwarningf(
"%s -> %s: spline size > 1 not supported\n",
308 const size_t size = bez->
size;
331 agwarningf(
"%s -> %s: head not inside head cluster %s\n",
342 "%s -> %s: tail is inside head cluster %s\n",
353 starti, 0, &nbez, bez->
eflag);
358 for (endi = 0; endi < size - 1; endi += 3) {
362 if (endi == size - 1) {
369 starti, endi, &nbez, bez->
eflag);
391 agwarningf(
"%s -> %s: tail not inside tail cluster %s\n",
402 "%s -> %s: head is inside tail cluster %s\n",
408 bez->
list[starti] = p;
414 endi - 3, &nbez, bez->
sflag);
418 for (starti = endi; starti > 0; starti -= 3) {
420 for (
size_t i = 0; i < 4; i++)
421 pts[i] = bez->
list[starti - i];
423 for (
size_t i = 0; i < 4; i++)
424 bez->
list[starti - i] = pts[i];
428 if (starti == 0 && bez->
sflag) {
430 }
else if (starti != 0) {
434 endi - 3, &nbez, bez->
sflag);
448 nbez.
size = endi - starti + 1;
450 for (
size_t i = 0, j = starti; i < nbez.
size; i++, j++)
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
size_t arrowStartClip(edge_t *e, pointf *ps, size_t startp, size_t endp, bezier *spl, uint32_t sflag)
size_t arrowEndClip(edge_t *e, pointf *ps, size_t startp, size_t endp, bezier *spl, uint32_t eflag)
CDT_API int dtclose(Dt_t *)
pointf Bezier(pointf *V, double t, pointf *Left, pointf *Right)
Dt_t * mkClustMap(Agraph_t *g)
Agraph_t * findCluster(Dt_t *map, char *name)
static pointf boxIntersectf(pointf pp, pointf cp, boxf *bp)
static int splineIntersectf(pointf *pts, boxf *bb)
static int countVertCross(pointf *pts, double xcoord)
static graph_t * getCluster(char *cluster_name, Dt_t *map)
static void makeCompoundEdge(edge_t *e, Dt_t *clustMap)
static double findVertical(pointf *pts, double tmin, double tmax, double xcoord, double ymin, double ymax)
void dot_compoundEdges(graph_t *g)
static double findHorizontal(pointf *pts, double tmin, double tmax, double ycoord, double xmin, double xmax)
static int countHorzCross(pointf *pts, double ycoord)
static int inBoxf(pointf p, boxf *bb)
static pointf mid_pointf(pointf p, pointf q)
char * agget(void *obj, char *name)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
char * agnameof(void *)
returns a string descriptor for the object.
Arithmetic helper functions.
static int fcmp(double a, double b)
comparator for doubles
static int sign(double v)