coordinate mapping [message #148298] |
Sat, 21 August 2004 16:23 |
Bernd Hofner Messages: 68 Registered: July 2009 |
Member |
|
|
Hello,
I'd like to use the XYLayout to generate a simple technical drawing.
Naturally, my model coordinates are in some real-world unit, like
millimetres.
I guess that draw2d uses pixel coordinates when placing figures.
How do I map between the two coordinate systems?
Is it possible to set a org.eclipse.draw2d.geometry.Transform object on a
view?
Or do I have to translate my model coordinates to the draw2d coordinates
each time I update my EditPart/Figure from the model?
If so, how do I get the scaling factors?
I can compuse the largest x/y extend of my model components and would get
something like realWorldMaxX and realWorldMaxY.
To get a scaling factor I would need the x/y extend of the canvas, which
probably changes if I use
the GEF Zooming features.
Any hints?
Cheers,
Bernd
|
|
|
Powered by
FUDForum. Page generated in 0.04489 seconds