Boost logo

Boost :

From: Jens Müller (jens.mueller_at_[hidden])
Date: 2006-05-31 04:41:53


This code:

> // Update positions
> for (tie(v, v_end) = vertices(g); v != v_end; ++v) {
> BOOST_USING_STD_MIN();
> BOOST_USING_STD_MAX();
> Dim disp_size = sqrt(displacement[*v].x * displacement[*v].x
> + displacement[*v].y * displacement[*v].y);
> position[*v].x += displacement[*v].x / disp_size
> * min BOOST_PREVENT_MACRO_SUBSTITUTION (disp_size, temp);
> position[*v].y += displacement[*v].y / disp_size
> * min BOOST_PREVENT_MACRO_SUBSTITUTION (disp_size, temp);
> position[*v].x = min BOOST_PREVENT_MACRO_SUBSTITUTION
> (width / 2,
> max BOOST_PREVENT_MACRO_SUBSTITUTION(-width / 2,
> position[*v].x));
> position[*v].y = min BOOST_PREVENT_MACRO_SUBSTITUTION
> (height / 2,
> max BOOST_PREVENT_MACRO_SUBSTITUTION(-height / 2,
> position[*v].y));
> }

determines the both how objects with strong forces in one direction are
"slowed down" and how clipping is done when nodes are about to leave the
drawing area.

IMO, this should be a bit more generic.

E.g., another clipping strategy would be to let nodes "bounce" from the
walls.

The way the temperature is taken into account could also be different (I
presume you have taken it from literature? All these values etc. seem to
be largely based on experiments ...).

Btw, does anyone have a better test program (e.g., reading and writing
Graphviz, together with a sufficiently large example graph)?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk