Ejemplo n.º 1
0
void circo_init_graph(graph_t * g)
{
    setEdgeType (g, ET_LINE);
    /* GD_ndim(g) = late_int(g,agfindattr(g,"dim"),2,2); */
    Ndim = GD_ndim(g) = 2;	/* The algorithm only makes sense in 2D */
    circular_init_node_edge(g);
}
Ejemplo n.º 2
0
void    FloorTri::read_0002     ( Iff & iff )
{
	ConnectedTri::read_0000(iff);

	setNormal( iff.read_floatVector() );

	setEdgeType( 0, static_cast<FloorEdgeType>(iff.read_uint8()) );
	setEdgeType( 1, static_cast<FloorEdgeType>(iff.read_uint8()) );
	setEdgeType( 2, static_cast<FloorEdgeType>(iff.read_uint8()) );

	setFallthrough( iff.read_bool8() );

    setPartTag( iff.read_int32() );

    setPortalId( 0, iff.read_int32() );
    setPortalId( 1, iff.read_int32() );
    setPortalId( 2, iff.read_int32() );
}
Ejemplo n.º 3
0
static void sfdp_init_graph(Agraph_t * g)
{
    int outdim;

    setEdgeType(g, ET_LINE);
    outdim = late_int(g, agfindgraphattr(g, "dimen"), 2, 2);
    GD_ndim(agroot(g)) = late_int(g, agfindgraphattr(g, "dim"), outdim, 2);
    Ndim = GD_ndim(agroot(g)) = MIN(GD_ndim(agroot(g)), MAXDIM);
    GD_odim(agroot(g)) = MIN(outdim, Ndim);
    sfdp_init_node_edge(g);
}
Ejemplo n.º 4
0
void dot_layout(Agraph_t * g)
{
    setEdgeType (g, ET_SPLINE);
    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.º 5
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.º 6
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);
}
Ejemplo n.º 7
0
void sfdp_layout(graph_t * g)
{
    int doAdjust;
    adjust_data am;
    int hops = -1;
    sfdp_init_graph(g);
    doAdjust = (Ndim == 2);

    if (agnnodes(g)) {
	Agraph_t **ccs;
	Agraph_t *sg;
	int ncc;
	int i;
	expand_t sep;
	pointf pad;
	spring_electrical_control ctrl = spring_electrical_control_new();

	tuneControl (g, ctrl);
#if (HAVE_GTS || HAVE_TRIANGLE)
	graphAdjustMode(g, &am, "prism0");
#else
	graphAdjustMode(g, &am, 0);
#endif

	if ((am.mode == AM_PRISM) && doAdjust) {
	    doAdjust = 0;  /* overlap removal done in sfpd */
	    ctrl->overlap = am.value;
    	    ctrl->initial_scaling = am.scaling;
	    sep = sepFactor(g);
	    if (sep.doAdd) {
		pad.x = PS2INCH(sep.x);
		pad.y = PS2INCH(sep.y);
	    } else {
		pad.x = PS2INCH(DFLT_MARGIN);
		pad.y = PS2INCH(DFLT_MARGIN);
	    }
	}
	else {
   		/* Turn off overlap removal in sfdp if prism not used */
	    ctrl->overlap = -1;
	}

	ccs = ccomps(g, &ncc, 0);
	if (ncc == 1) {
	    sfdpLayout(g, ctrl, hops, pad);
	    if (doAdjust) removeOverlapWith(g, &am);
	    spline_edges(g);
	} else {
	    pack_info pinfo;
	    getPackInfo(g, l_node, CL_OFFSET, &pinfo);
	    pinfo.doSplines = 1;

	    for (i = 0; i < ncc; i++) {
		sg = ccs[i];
		nodeInduce(sg);
		sfdpLayout(sg, ctrl, hops, pad);
		if (doAdjust) removeOverlapWith(sg, &am);
		setEdgeType(sg, ET_LINE);
		spline_edges(sg);
	    }
	    packSubgraphs(ncc, ccs, g, &pinfo);
	}
	for (i = 0; i < ncc; i++) {
	    agdelete(g, ccs[i]);
	}
	free(ccs);
	spring_electrical_control_delete(ctrl);
    }

    dotneato_postprocess(g);
}