35#if defined(DEBUG) && DEBUG > 1
39 for (
size_t j = 0; j < p->
pn; j++) {
41 fprintf(stderr,
" %.5g %.5g", pt.
x, pt.
y);
46static void dumpObjlist(
const objlist_t *l) {
47 for (
size_t i = 0; i < objlist_size(l); i++) {
48 dumpObj(objlist_get(l, i));
67 ctr.
x = (bb.
UR.
x + bb.
LL.
x) / 2.0;
68 ctr.
y = (bb.
UR.
y + bb.
LL.
y) / 2.0;
78 double deltay = pm->
y - 1.0;
80 newbb.
UR.
y = pm->
y * bb.
UR.
y - deltay * ctr.
y;
82 newbb.
LL.
y = pm->
y * bb.
LL.
y - deltay * ctr.
y;
117 if (sg != tex && sg != hex) {
136 for (i = maxlvl; i > minlvl; i--) {
160 objlist_t list = {0};
176 if (hlevel > tlevel) {
177 raiseLevel(&list, hlevel, hex, tlevel, &hg, pm);
180 }
else if (tlevel > hlevel) {
181 raiseLevel(&list, tlevel, tex, hlevel, &tg, pm);
225 assert(objlist_size(&objl) <= INT_MAX);
228 vconfig =
Pobsopen(objlist_front(&objl), (
int)objlist_size(&objl));
230 agwarningf(
"compoundEdges: could not construct obstacles - falling back to straight line edges\n");
240 agwarningf(
"compoundEdges: nodes touch - falling back to straight line edges\n");
241 if (pack <= pm->x || pack <= pm->y)
242 agerr(
AGPREV,
"pack value %d is smaller than esep (%.03f,%.03f)\n", pack, pm->
x, pm->
y);
243 else if (margin.
x <= pm->
x || margin.
y <= pm->
y)
244 agerr(
AGPREV,
"sep value (%.03f,%.03f) is smaller than esep (%.03f,%.03f)\n",
245 margin.
x, margin.
y, pm->
x, pm->
y);
258 assert(objlist_size(&objl) <= INT_MAX);
260 makeSpline(e0, objlist_front(&objl), (
int)objlist_size(&objl),
false);
266 if (vconfig !=
NULL) {
expand_t sepFactor(graph_t *g)
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
static objlist_t objectList(edge_t *ep, expand_t *pm)
static void raiseLevel(objlist_t *l, int maxlvl, void *ex, int minlvl, graph_t **gp, expand_t *pm)
int compoundEdges(graph_t *g, expand_t *pm, int edgetype)
static void addGraphObjs(objlist_t *l, graph_t *g, void *tex, void *hex, expand_t *pm)
static Ppoly_t * makeClustObs(graph_t *g, expand_t *pm)
vconfig_t * Pobsopen(Ppoly_t **obs, int n_obs)
void Pobsclose(vconfig_t *config)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
void agwarningf(const char *fmt,...)
int agerr(agerrlevel_t level, const char *fmt,...)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
int Plegal_arrangement(Ppoly_t **polys, int n_polys)
#define DEFINE_LIST(name, type)
NEATOPROCS_API void makeSelfArcs(edge_t *e, int stepx)
NEATOPROCS_API void makeSpline(edge_t *, Ppoly_t **, int, bool)
NEATOPROCS_API Ppolyline_t getPath(edge_t *, vconfig_t *, bool)
NEATOPROCS_API Ppoly_t * makeObstacle(node_t *n, expand_t *, bool)
int getPack(Agraph_t *g, int not_def, int dflt)
support for connected components