Ejemplo n.º 1
0
void dot_layout(Agraph_t * g)
{
    dot_init_node_edge(g);
    dot_rank(g);
    dot_mincross(g);
    /* dumpRanks (g); */
    dot_position(g);
    /* dumpRanks (g); */
    dot_sameports(g);
    dot_splines(g);
    if (mapbool(agget(g, "compound")))
	dot_compoundEdges(g);
    dotneato_postprocess(g);
}
Ejemplo n.º 2
0
/*
 * A cluster is collapsed in three steps.
 * 1) The nodes of the cluster are ranked locally.
 * 2) The cluster is collapsed into one node on the least rank.
 * 3) In class1(), any inter-cluster edges are converted using
 *    the "virtual node + 2 edges" trick.
 */
static void 
collapse_cluster(graph_t * g, graph_t * subg)
{
    if (GD_cluster_was_collapsed(subg))
	return;
    GD_cluster_was_collapsed(subg) = TRUE;
    node_induce(g, subg);
    if (agfstnode(subg) == NULL)
	return;
    make_new_cluster(g, subg);
    if (CL_type == LOCAL) {
	dot_rank(subg, 0, NULL);
	cluster_leader(subg);
    } else
	dot_scan_ranks(subg);
}
Ejemplo n.º 3
0
void dot_layout_intl(Agraph_t * g, struct _DotStats* stats) {
    aspect_t aspect;
    aspect_t* asp;

    setEdgeType (g, ET_SPLINE);
    asp = setAspect (g, &aspect);

    dot_init_node_edge(g);
    do {
		dot_rank(g, asp, stats);
		resetNodeCountOnRanks(g);
    	if(stats->stopFunc && stats->stopFunc(PROGRESS_AFTER_RANK)) {
    		return;
    	}

	if (aspect.badGraph) {
		agerr(AGWARN, "dot does not support the aspect attribute for disconnected graphs or graphs with clusters\n");
		asp = NULL;
		aspect.nextIter = 0;
	}

        dot_mincross(g,  (asp != NULL), stats);
    	if(stats->stopFunc && stats->stopFunc(PROGRESS_AFTER_MX)) {
    		return;
    	}

        dot_position(g, asp, stats);
    	if(stats->stopFunc && stats->stopFunc(PROGRESS_AFTER_POSITION)) {
    		return;
    	}
	aspect.nPasses--;
    } while (aspect.nextIter && aspect.nPasses);

    dot_sameports(g);
    dot_splines(g);
    if (mapbool(agget(g, "compound")))
	dot_compoundEdges(g);
    dotneato_postprocess(g);

	if(stats->stopFunc) {
		stats->stopFunc(PROGRESS_LAYOUT_FINISH);
	}
}
Ejemplo n.º 4
0
static void dotLayout(Agraph_t * g)
{
    aspect_t aspect;
    aspect_t* asp;
    int maxphase = late_int(g, agfindgraphattr(g,"phase"), -1, 1);

    setEdgeType (g, ET_SPLINE);
    asp = setAspect (g, &aspect);

    dot_init_subg(g,g);
    dot_init_node_edge(g);

    do {
        dot_rank(g, asp);
	if (maxphase == 1) {
	    attach_phase_attrs (g, 1);
	    return;
	}
	if (aspect.badGraph) {
	    agerr(AGWARN, "dot does not support the aspect attribute for disconnected graphs or graphs with clusters\n");
	    asp = NULL;
	    aspect.nextIter = 0;
	}
        dot_mincross(g, (asp != NULL));
	if (maxphase == 2) {
	    attach_phase_attrs (g, 2);
	    return;
	}
        dot_position(g, asp);
	if (maxphase == 3) {
	    attach_phase_attrs (g, 2);  /* positions will be attached on output */
	    return;
	}
	aspect.nPasses--;
    } while (aspect.nextIter && aspect.nPasses);
    if (GD_flags(g) & NEW_RANK)
	removeFill (g);
    dot_sameports(g);
    dot_splines(g);
    if (mapbool(agget(g, "compound")))
	dot_compoundEdges(g);
}