Re: Flexible, modular dia line decoration code



Hi,

Here's some follow up info, and an EPS file showing more complete arrow results. The arrow generating engine is pretty complete and quite general, and it appears stable. The GUI (using properties), is hardly modular for the time being, but the arrow engine code is written to permit this easily. I've attached the code to Bug ID 98593 if somebody wants to try it out.

The GUI just calls functions to create a few home-made arrows, allowing the user to specify only one (symmetry) of the many arrow options.

The GUI does NOT allow one to superimpose several different user-specified arrow heads, and many arrow specifications can not be specified with the gui. But this may give you an idea what is possible with more general code. I agree that the color stuff is a bit kitchy, but hey, it came along for free.

Lines are drawn with round caps so that intersections of wide lines won't look bad. The code, however, allows dia standard arrows to be used as decorations, which should result in modular code that could use sharp-tipped arrows as components.

Most of the new arrow code is in the bondgraph library for now. There is a 'MTT Bond' object that uses this arrow code (click on the causality options, to see). But this object is not very interesting from a arrow point of view. There is another line object that I used to draw the attached diagram.

See my previous post for more info about these arrows, and the ORIENTATION property, and how this works. The principle addition is a 'Repeat' structure which defines a transformation affecting angle, color, and placement-defining gaps. Given a DecorationProp (which defines a simple decoration), a Repeat structure can be used iterate on the DecorationProp, transforming it with each iteration, generating a GList of DecorationProps. Both the DecorationProp and the Repeat structure are general enough to allow almost any kind of arrow, and also to allow any dimension to be a fixed length, a general function of line width, proportional to visible line length, or some combination of these.

As usual, these files are copyrighted (2002) by David Hoover, and you can use and copy the stuff according to the GNU General Public License (GPL) as distributed with dia, and found on http://www.gnu.org.

Dave.


Attachment: gallery.dia.gz
Description: GNU Zip compressed data

Attachment: gallery.eps.gz
Description: GNU Zip compressed data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]