[Qt-interest] Coordinate system decision

Dan White ygor at comcast.net
Mon Mar 30 14:38:26 CEST 2009


How about this as a very simple solution:
A pair of (global/top level) coordinate transformation methods.  All internal stuff uses the "native" top left.  All input is transformed as a first step, all output is transformed as a last step. 

“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin & Hobbes)

----- Original Message -----
From: Bastian Bense <bastibense at gmail.com>
To: qt-interest at trolltech.com
Sent: Mon, 30 Mar 2009 10:29:21 +0000 (UTC)
Subject: [Qt-interest] Coordinate system decision

Hey folks,

I'm about to begin an implementation for a work project which manages
layouts and layout contents, and I've got to make a technical decision
about wether to use coordinates beginning at the top-left or
bottom-left corner.

The coordinate data I have to work with (importing, exporting) is 99%
based on a bottom-left coordinate system. I'll also have to control a
PDF library in order generate preview sheets and the PDF-library
(normal for PDF and PostScript) also is based on a bottom-left
coordinate system.

User feedback and bug reports usually provide bottom-left coordinates,
so that would help with the debugging.

Qt offers a number of classes for managing coordinates and objects,
such as QRect(), QPoint(), etc, but most of them rely on a top-left
coordinate system - especially the methods of QRect(), such as
setRight(), setBottom(). I think it would be nice to be able to use
them, though.

I once made a bad decision in the past by internally managing all
coordinates in a top-left coordinate system to have less problems
displaying them - but that resulted in A LOT more work when importing,
exporting and actually working with the data.

One idea is to use QTransform to help a bit with the exporting of
rotated, recursive objects (layouts within layouts).

Any suggestions, ideas, feedback? I'd love to hear your thoughts, so I
can make the best decision possible.

Thanks in advance,
Bastian
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest





More information about the Qt-interest-old mailing list