I have been thinking about rotation a bit, and I don't think it will be
too difficult to add rotation support to every object in dia without
modifying a single object.

First we need to add support for rotated text to the renderer interface.
I have code to do text rotation on X, and libart, eps, cgm and svg all
support this natively.

Now we can create a `rotating renderer'.  Basically a renderer that takes
rendering commands in one end, transforms them and passes them on to
another renderer.  Now we just add a few fields to the base Object
structure to hold rotation info.  Now when drawing an object, we can use
the passthrough renderer to do the rotation.  Positioning of handles and
connection points and calculating the bounding box would also have to take
this into account.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On Mon, 27 Mar 2000, T. Tam wrote:

> Hi,
>       
>       Is there any way to implement (or is it already
> implemented?) arbitary rotation of the drawn objects? 
> 
>       I'm writing (okay, trying to write, once I get more of this SVG
> stuff figured out) a chemistry template for DIA.  I think with good design
> on the template's part DIA could beat out most Windows based Chemistry
> structure drawing programs that I've seen (with the exception of ChemDraw
> Ultra, but that's a $1500.00 program).  The problem, of course, is
> rotation of the bonds.  I *can* code in the bonds at the most common
> orientations (ie, 30 degrees, 60 deg, 72 deg, 104.9 deg, etc...) but it
> would be MUCH more elegant to implement.
> 
>       Since SVG is just vectors, rotation would just mean multiplying
> the coordinates of the vector with a certain matrix (Need to dig out my
> linear algebra book on that, but it shouldn't be difficult to
> implement...).  What do you all think?
> 
> -=- Terence
> 
> -- 
> 
> /* -------------------------------------------------------------
> Terence Tak-Shing Tam <[EMAIL PROTECTED]>
> http://students.washington.edu/ttstam/
> 
> "Our yellow sun yields to the dark, as I begin my web-based lark,
> Flowing turning, thru the pipes, I grep for text and dump the hype,
> But as I ride the fibre trail, I test my faith as as I read my mail,
> Even as my bandwidth fattens, I question life and 1-click patents,
> Although I ask and though I query, I know the truth, I grok the theory,
> Life is a multimedia of sins, so he who collects the most m-peg wins 
> 
>                               -=- Illiad,    UserFriendly.org
> --------------------------------------------------------------*/
> 

Reply via email to