From: Ralf H. <ral...@gm...> - 2006-11-01 18:05:42
|
Hi Juan, > First of all, two questions: > 1 - Someone has compiled/run this code? I have found at least 2 error > during the direct compilation (very easy to solve) It should be compiled (at least), but the last changes have been quite uncoordinated... sorry > 2 - In a first run after compilation, I have seen that the code to show the > Places/Waypoints are missing but exist on v0.9.2.3.3pre, is there any > reason or just an omission? The reason is, that not all developers used CVS ... sorry again But now it is mandatory (but it will probably change from cvs to svn). > My next work is to transfer my previous work done over v0.9.2.3.3 to this > version. Before, I want to tell you some of the chages I have incorporated > in order to get your opinions/approval: > 1 - Add MapSelector class as said on todo.txt: no comments (although I > haven used QPixmapCache as explained later). The idea of the QPixmapCache was based on the later possibility to use the code for vector maps (drawing this maps takes some time, so there was the idea of caching). Caching makes sense for tiles as well, but it can be done a lot of different ways (e.g. manually select which tiles have to be loaded from disc and which are kept inside the memory...). It's just important that it is not necessary to load all tiles into the memory... > 2 - Improve map detection: Now to search which maps to include on > actMapList it calls calcxy(...), that is a quite complex function, so it > only search a few maps each iteration. I have improved this search adding > as members of each map (on MapBase) the limits of the map (nort, south, > west and east). This limits are calculated on the map constructor and > checked on a funciton isInside(latitude, longitude) that is used in the map > search and also to draw traks and places. Using this operation searching on > a list of about 1000 maps it only takes 2-3 ms. Calcxy was needed, if several maps are partially inside the display. How do you handle this situation now ? (do you check which map has the best coverage if 2 maps are "inside" but do not cover the whole display; ok, this is less important if tiled maps are available). > 3 - Improve map drawing (specially when large tracks/places are shown). In > my code when a map is detected to cover the current position, the image is > loaded into a QPixmap and then MapDisp::createMap do a bitblt (throught a > MapSelector::DrawMap function)that is faster than the current > convertFromImage(...). > Also I pre-draw the track and the places/waypoints > into the Qpixmap during the map loading so MapDisp doesn't need to draw > them on each createMap iteration. yes, this parts needed some tuning > The idea is: you call MapDisp::createMap 4 times on a second, but you > detect a map afer several seconds (or minutes depending on your speed and > the maps zoom and dimensions), so I have tried to aligerate > MapDisp::createMap at the cost of more memory usage and more time to load a > map when it is detected to be on the cover area. Another idea was to calculate the distance between the current position and the maps and then sort the maps by this distance: the closer a map is, the more frequently it is checked. But if you found a fast and working way to do it, the better it is. Please be careful about memory usage, because some PDAs have only 32M. Which device are you using (Zaurus, Ipaq,...) ? > Please tell me your opinions about my work and if you think that I should > add this changes to the current qpegps. Great job, keep on going ! Thanks, Ralf |