PDA

View Full Version : Is there any Qt function which gives all the connecting between any two coordinates ?



ahmadka
13th June 2010, 13:05
Hi guys ... I was wondering if there's any predefined Qt function which gives a list of connecting points between any two coordinates in a coordinate system, such that the list of connecting points 'connect' the two coordinates so that there are no breaks between them ... Is there any such function ... ?

This is similar to drawing a line between any two coordinates, but instead of drawing the line, you store all the points that would be in that line into an array or something, and pass this array as an output ..

tbscope
13th June 2010, 13:37
Not directly, as far as I know.
But you might want to take a look at a painter path:
http://doc.qt.nokia.com/4.6/qpainterpath.html

Or find the points yourself (very easy).

Why do you want to have that list?
A line is not defined by more than two points.

wysota
13th June 2010, 13:41
You mean Bresenham's line drawing algorithm?

http://en.wikipedia.org/wiki/Bresenham's_line_algorithm