44 static void dumpObj(
Ppoly_t * p)
48 for (j = 0; j < p->
pn; j++) {
50 fprintf(stderr,
" %.5g %.5g", pt.
x, pt.
y);
55 static void dumpObjlist(
objlist * l)
58 for (i = 0; i < l->
cnt; i++) {
66 if (l->
sz == l->
cnt) {
81 static void freeObjlist(
objlist * l)
93 static void resetObjlist(
objlist * l)
112 ctr.
x = (bb.
UR.
x + bb.
LL.
x) / 2.0;
113 ctr.
y = (bb.
UR.
y + bb.
LL.
y) / 2.0;
124 newbb.
UR.
x = pm->
x * bb.
UR.
x - deltax * ctr.
x;
125 newbb.
UR.
y = pm->
y * bb.
UR.
y - deltay * ctr.
y;
126 newbb.
LL.
x = pm->
x * bb.
LL.
x - deltax * ctr.
x;
127 newbb.
LL.
y = pm->
y * bb.
LL.
y - deltay * ctr.
y;
131 obs->
ps[0].
x = newbb.
LL.
x;
132 obs->
ps[0].
y = newbb.
LL.
y;
133 obs->
ps[1].
x = newbb.
LL.
x;
134 obs->
ps[1].
y = newbb.
UR.
y;
135 obs->
ps[2].
x = newbb.
UR.
x;
136 obs->
ps[2].
y = newbb.
UR.
y;
137 obs->
ps[3].
x = newbb.
UR.
x;
138 obs->
ps[3].
y = newbb.
LL.
y;
157 if ((
PARENT(n) == g) && (n != tex) && (n != hex)
164 if ((sg != tex) && (sg != hex)) {
165 addObj(l, makeClustObs(sg, pm));
177 raiseLevel(
objlist * l,
int maxlvl,
void *ex,
int minlvl,
graph_t ** gp,
183 for (i = maxlvl; i > minlvl; i--) {
184 addGraphObjs(l, g, ex,
NULL, pm);
224 if (hlevel > tlevel) {
225 raiseLevel(list, hlevel, hex, tlevel, &hg, pm);
228 }
else if (tlevel > hlevel) {
229 raiseLevel(list, tlevel, tex, hlevel, &tg, pm);
236 addGraphObjs(list, hg,
NULL, hex, pm);
237 addGraphObjs(list, tg, tex,
NULL, pm);
243 addGraphObjs(list, tg, tex, hex, pm);
276 objl = objectList(e, pm);
280 agerr(
AGWARN,
"compoundEdges: could not construct obstacles - falling back to straight line edges\n");
289 agerr(
AGWARN,
"compoundEdges: nodes touch - falling back to straight line edges\n");
290 if ((pack <= pm->x) || (pack <= pm->y))
291 agerr(
AGPREV,
"pack value %d is smaller than esep (%.03f,%.03f)\n", pack, pm->
x, pm->
y);
292 else if ((margin.
x <= pm->
x) || (margin.
y <= pm->
y))
293 agerr(
AGPREV,
"sep value (%.03f,%.03f) is smaller than esep (%.03f,%.03f)\n",
294 margin.
x, margin.
y, pm->
x, pm->
y);
#define RALLOC(size, ptr, type)
void makeSpline(graph_t *, edge_t *, Ppoly_t **, int, boolean)
expand_t sepFactor(graph_t *g)
int agerr(agerrlevel_t level, const char *fmt,...)
CGRAPH_API Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
int compoundEdges(graph_t *g, expand_t *pm, int edgetype)
int Plegal_arrangement(Ppoly_t **polys, int n_polys)
CGRAPH_API Agnode_t * agtail(Agedge_t *e)
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Ppolyline_t getPath(edge_t *, vconfig_t *, int, Ppoly_t **, int)
CGRAPH_API Agnode_t * aghead(Agedge_t *e)
vconfig_t * Pobsopen(Ppoly_t **obs, int n_obs)
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
int getPack(Agraph_t *g, int not_def, int dflt)
Ppoly_t * makeObstacle(node_t *n, expand_t *, boolean)
CGRAPH_API int agnnodes(Agraph_t *g)
void makeSelfArcs(path *P, edge_t *e, int stepx)
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)