You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Paul F. <pg...@us...> - 2006-07-04 15:48:19
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23588/gtk Modified Files: Makefile Log Message: strip the targets after installation, not before. (otherwise no copy remains with symbols.) (could use "install -s", i suppose.) Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk/Makefile,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Makefile 28 Jun 2006 12:23:57 -0000 1.21 --- Makefile 4 Jul 2006 15:48:08 -0000 1.22 *************** *** 34,38 **** install: - $(STRIP) $(TARGETS) mkdir -p $(DESTDIR)$(bindir) cd $(DESTDIR)$(bindir) && rm -f $(TARGETS) roadmap roadgps --- 34,37 ---- *************** *** 40,43 **** --- 39,43 ---- ln -s gtkroadmap $(DESTDIR)$(bindir)/roadmap ln -s gtkroadgps $(DESTDIR)$(bindir)/roadgps + cd $(DESTDIR)$(bindir) ; $(STRIP) $(TARGETS) uninstall: |
From: Paul F. <pg...@us...> - 2006-07-04 15:48:18
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23588/gtk2 Modified Files: Makefile Log Message: strip the targets after installation, not before. (otherwise no copy remains with symbols.) (could use "install -s", i suppose.) Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/Makefile,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Makefile 27 Jun 2006 20:16:45 -0000 1.26 --- Makefile 4 Jul 2006 15:48:09 -0000 1.27 *************** *** 40,44 **** install: - $(STRIP) $(TARGETS) mkdir -p $(DESTDIR)$(bindir) cd $(DESTDIR)$(bindir) && rm -f $(TARGETS) roadmap roadgps --- 40,43 ---- *************** *** 46,49 **** --- 45,49 ---- ln -s gtkroadmap $(DESTDIR)$(bindir)/roadmap ln -s gtkroadgps $(DESTDIR)$(bindir)/roadgps + cd $(DESTDIR)$(bindir) ; $(STRIP) $(TARGETS) uninstall: |
From: Paul F. <pg...@us...> - 2006-07-03 17:20:38
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29879 Modified Files: README Log Message: update currenttrack filename to agree with code. note that the current track file and personal landmarks file do not live with the trip files. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** README 1 Jul 2006 14:28:11 -0000 1.94 --- README 3 Jul 2006 17:20:34 -0000 1.95 *************** *** 1624,1628 **** Normally the recorded track will be saved in the configured filename. ! The default for this file is "current_track.gpx". If one wishes to record tracks, but never save them to disk, set the filename to the special value "NONE". --- 1624,1628 ---- Normally the recorded track will be saved in the configured filename. ! The default for this file is "currenttrack.gpx". If one wishes to record tracks, but never save them to disk, set the filename to the special value "NONE". *************** *** 2801,2808 **** In addition to the trip files, there are two other important files which are also stored in GPX format. ! The "Current Track" file contains waypoints representing where you've been -- a "breadcrumb trail", if you will. ! This file (called "current_track.gpx" by default) will only contain a single track when written. When read (on startup, to restore previous state), only the first --- 2801,2808 ---- In addition to the trip files, there are two other important files which are also stored in GPX format. ! The "Current Track" file contains waypoints representing where you've been -- a "breadcrumb trail", if you will. ! This file (called "currenttrack.gpx" by default) will only contain a single track when written. When read (on startup, to restore previous state), only the first *************** *** 2821,2829 **** in the file are ignored. ! Note that since these files are in GPX format, they can also ! be manually opened as trips. In this case, the landmarks associated ! with the "Personal Landmarks" file will appear as "Trip Landmarks" ! for that trip, and the track in "Current Track" will appear as ! the only unnamed track in that trip. --- 2821,2827 ---- in the file are ignored. ! (These files are not stored in the same directory as the other ! trip files, but instead in the same directory in which the ! user's preferences and session file are found.) |
From: Paul F. <pg...@us...> - 2006-07-03 17:10:40
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23212 Modified Files: roadmap_landmark.c roadmap_track.c Log Message: move the current track and personal landmarks files from the trips subdir to the "user" directory. they're not really "trips" (they get maintained automatically) and they shouldn't show up in the trip file dialog. very tempting, and then confusing, to open one of them as a trip. Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_landmark.c 8 Dec 2005 21:13:55 -0000 1.4 --- roadmap_landmark.c 3 Jul 2006 17:10:35 -0000 1.5 *************** *** 131,135 **** name = roadmap_landmark_filename (&defaulted); ! ret = roadmap_gpx_write_waypoints(roadmap_path_trips(), name, &RoadMapLandmarkHead); --- 131,135 ---- name = roadmap_landmark_filename (&defaulted); ! ret = roadmap_gpx_write_waypoints(roadmap_path_user(), name, &RoadMapLandmarkHead); *************** *** 194,198 **** const char *name; ! const char *path = roadmap_path_trips(); queue tmp_waypoint_list; int defaulted, ret; --- 194,198 ---- const char *name; ! const char *path = roadmap_path_user(); queue tmp_waypoint_list; int defaulted, ret; Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_track.c 26 Jun 2006 14:19:08 -0000 1.7 --- roadmap_track.c 3 Jul 2006 17:10:35 -0000 1.8 *************** *** 306,310 **** if (name == NULL) return; ! ret = roadmap_gpx_write_track(roadmap_path_trips(), name, RoadMapTrack); if (ret == 0) return; --- 306,310 ---- if (name == NULL) return; ! ret = roadmap_gpx_write_track(roadmap_path_user(), name, RoadMapTrack); if (ret == 0) return; *************** *** 321,325 **** const char *name; ! const char *path = roadmap_path_trips(); int defaulted, ret; --- 321,325 ---- const char *name; ! const char *path = roadmap_path_user(); int defaulted, ret; |
From: Paul F. <pg...@us...> - 2006-07-03 13:22:02
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1653 Modified Files: roadmap_label.c roadmap_label.h Log Message: make the size of the so-called label "cache" dynamic, to better accomodate large capacity hosts. small devices with large screen areas may suffer, though. Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_label.c 1 Jul 2006 21:44:41 -0000 1.7 --- roadmap_label.c 3 Jul 2006 13:21:58 -0000 1.8 *************** *** 29,32 **** --- 29,33 ---- #include <stdlib.h> + #include <string.h> #include "roadmap_config.h" *************** *** 78,87 **** for (ai = 0; ai < 4; ai++) { for (bi = 0; bi < 4; bi++) { ! if (roadmap_math_screen_intersect( &a[ai], &a[(ai+1)%4], &b[bi], &b[(bi+1)%4], &isect)) { ! if (point_in_bbox(&isect, &c1->bbox) && ! point_in_bbox(&isect, &c2->bbox)) ! return 1; ! } } } --- 79,88 ---- for (ai = 0; ai < 4; ai++) { for (bi = 0; bi < 4; bi++) { ! if (roadmap_math_screen_intersect( &a[ai], &a[(ai+1)%4], &b[bi], &b[(bi+1)%4], &isect)) { ! if (point_in_bbox(&isect, &c1->bbox) && ! point_in_bbox(&isect, &c2->bbox)) ! return 1; ! } } } *************** *** 108,112 **** static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect) { RoadMapGuiPoint q; int x1=0, y1=0; --- 109,113 ---- static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect) { RoadMapGuiPoint q; int x1=0, y1=0; *************** *** 155,158 **** --- 156,192 ---- } + static int roadmap_label_check_allocations(void) { + + if (!RoadMapLabelCache.labels) { + + RoadMapLabelCache.maxlabels = MIN_LABELS; + + RoadMapLabelCache.labels = malloc(MIN_LABELS * sizeof(labelCacheObj)); + roadmap_check_allocated (RoadMapLabelCache.labels ); + + memset (RoadMapLabelCache.labels, + 0, MIN_LABELS * sizeof(labelCacheObj)); + + } else if (RoadMapLabelCache.numlabels == RoadMapLabelCache.maxlabels) { + + if (RoadMapLabelCache.maxlabels == MAX_LABELS) { + roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); + RoadMapLabelCacheFull = 1; + return -1; + } + + RoadMapLabelCache.maxlabels *= 2; + + RoadMapLabelCache.labels = realloc( RoadMapLabelCache.labels, + RoadMapLabelCache.maxlabels * sizeof(labelCacheObj)); + roadmap_check_allocated (RoadMapLabelCache.labels ); + + memset (&RoadMapLabelCache.labels[RoadMapLabelCache.numlabels], + 0, RoadMapLabelCache.numlabels * sizeof(labelCacheObj)); + + } + + return 0; + } int roadmap_label_add (const RoadMapGuiPoint *point, int angle, *************** *** 168,175 **** } ! ! if(RoadMapLabelCache.numlabels == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); ! RoadMapLabelCacheFull = 1; return -1; } --- 202,206 ---- } ! if (roadmap_label_check_allocations() != 0) { return -1; } *************** *** 203,208 **** RoadMapGuiPoint p; RoadMapGuiRect r; - // int label_offsetx = 0; - // int label_offsety = 0; const char *text; --- 234,237 ---- *************** *** 251,255 **** cachePtr->angle -= 90; - // p = get_metrics (&(cachePtr->point), &r, cachePtr->angle, &cachePtr->bbox); p = get_metrics (cachePtr, &r); } else { --- 280,283 ---- *************** *** 274,287 **** ! if(rect_overlap (&RoadMapLabelCache.labels[i]->bbox, &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient. else... */ if(!angles || ! poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; ! } } } --- 302,315 ---- ! if (rect_overlap (&RoadMapLabelCache.labels[i]->bbox, &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient. else... */ if(!angles || ! poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; ! } } } Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_label.h 30 Jun 2006 13:30:39 -0000 1.2 --- roadmap_label.h 3 Jul 2006 13:21:58 -0000 1.3 *************** *** 30,34 **** #include "roadmap_gui.h" ! #define MAX_LABELS 700 typedef struct { --- 30,36 ---- #include "roadmap_gui.h" ! /* should be related by a power of 2 */ ! #define MIN_LABELS 256 ! #define MAX_LABELS 2048 typedef struct { *************** *** 49,54 **** typedef struct { ! labelCacheMemberObj *labels[MAX_LABELS]; int numlabels; } labelCacheObj; --- 51,57 ---- typedef struct { ! labelCacheMemberObj **labels; int numlabels; + int maxlabels; } labelCacheObj; |
From: Paul F. <pg...@us...> - 2006-07-03 12:46:54
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13757/qt Modified Files: qt_canvas.cc Log Message: change QT_NO_ROTATE check to ifndef, so numeric value not needed Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** qt_canvas.cc 3 Jul 2006 01:30:49 -0000 1.10 --- qt_canvas.cc 3 Jul 2006 12:30:11 -0000 1.11 *************** *** 171,175 **** void RMapCanvas::drawStringAngle(RoadMapGuiPoint* position, int center, const char* text, int angle) { ! #if !QT_NO_ROTATE if (!pixmap) { return; --- 171,175 ---- void RMapCanvas::drawStringAngle(RoadMapGuiPoint* position, int center, const char* text, int angle) { ! #ifndef QT_NO_ROTATE if (!pixmap) { return; |
From: Paul F. <pg...@us...> - 2006-07-03 12:46:34
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12460 Modified Files: config.mk Log Message: remove default definition of QTDIR, to allow the user's environment to take precedence. Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** config.mk 1 Jul 2006 14:28:11 -0000 1.5 --- config.mk 3 Jul 2006 12:28:17 -0000 1.6 *************** *** 34,38 **** # if you select QT or QPE above, you might also want to set # QTDIR here: ! QTDIR = /usr # if you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in --- 34,38 ---- # if you select QT or QPE above, you might also want to set # QTDIR here: ! # QTDIR = /usr # if you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in |
From: Paul F. <pg...@us...> - 2006-07-03 12:39:27
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16878/qt Modified Files: Makefile Log Message: simplify QT build options (oleg gusev) Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/Makefile,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Makefile 28 Jun 2006 12:23:57 -0000 1.22 --- Makefile 3 Jul 2006 12:37:45 -0000 1.23 *************** *** 12,19 **** # --- QT-specific options ------------------------------------------------ ! CFLAGS += -I$(QTDIR)/include -I/usr/include/qt3 -I/usr/local/include/qt3 CFLAGS += -fno-rtti -fno-exceptions LIBS += -L$(QTDIR)/lib -lqt-mt ! ifeq ($(DESKTOP),QPE) --- 12,20 ---- # --- QT-specific options ------------------------------------------------ ! ifeq ($(DESKTOP),QT) ! CFLAGS += -I$(QTDIR)/include CFLAGS += -fno-rtti -fno-exceptions LIBS += -L$(QTDIR)/lib -lqt-mt ! endif ifeq ($(DESKTOP),QPE) |
From: Paul F. <pg...@us...> - 2006-07-03 01:30:52
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5785/qt Modified Files: qt_canvas.cc qt_main.cc qt_main.h roadmap_main.cc Log Message: implement QT tooltips, button icons, and initial width/height setting (patch from Oleg Gusev) Index: qt_main.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_main.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** qt_main.cc 27 Nov 2005 21:56:25 -0000 1.10 --- qt_main.cc 3 Jul 2006 01:30:49 -0000 1.11 *************** *** 64,68 **** // Implementation of RMapMainWindow class ! RMapMainWindow::RMapMainWindow(const char* name) : QMainWindow(0, name) { spacePressed = false; for (int i = 0 ; i < ROADMAP_MAX_TIMER; ++i) { --- 64,68 ---- // Implementation of RMapMainWindow class ! RMapMainWindow::RMapMainWindow(const char* name, int width, int height) : QMainWindow(0, name) { spacePressed = false; for (int i = 0 ; i < ROADMAP_MAX_TIMER; ++i) { *************** *** 70,78 **** tcb[i] = 0; } ! setCaption(name); canvas = new RMapCanvas(this); setCentralWidget(canvas); canvas->setFocus(); setToolBarsMovable(FALSE); toolBar = 0; } --- 70,79 ---- tcb[i] = 0; } ! setCaption(QString::fromUtf8(name)); canvas = new RMapCanvas(this); setCentralWidget(canvas); canvas->setFocus(); setToolBarsMovable(FALSE); + resize(width,height); toolBar = 0; } *************** *** 172,176 **** if (label != NULL) { ! QPushButton* b = new QPushButton(label, toolBar); b->setFocusPolicy(QWidget::NoFocus); RMapCallback* cb = new RMapCallback(callback); --- 173,185 ---- if (label != NULL) { ! const char *icopath=roadmap_path_search_icon(icon); ! QPushButton* b; ! ! if (icopath) ! b = new QPushButton(QIconSet( QPixmap(icopath) ),NULL, toolBar); ! else ! b = new QPushButton(label, toolBar); ! ! QToolTip::add( b, QString::fromUtf8(tip) ); b->setFocusPolicy(QWidget::NoFocus); RMapCallback* cb = new RMapCallback(callback); Index: qt_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_main.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** qt_main.h 18 Nov 2005 20:20:26 -0000 1.7 --- qt_main.h 3 Jul 2006 01:30:49 -0000 1.8 *************** *** 34,37 **** --- 34,38 ---- #include <qstatusbar.h> #include <qtimer.h> + #include <qtooltip.h> #define ROADMAP_MAX_TIMER 16 *************** *** 44,47 **** --- 45,49 ---- #include "roadmap_history.h" #include "roadmap_main.h" + #include "roadmap_path.h" typedef void (*RoadMapQtInput) (int fd); *************** *** 87,91 **** public: ! RMapMainWindow(const char* name); virtual ~RMapMainWindow(); --- 89,93 ---- public: ! RMapMainWindow(const char* name, int width, int height); virtual ~RMapMainWindow(); Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** qt_canvas.cc 30 Jun 2006 13:41:44 -0000 1.9 --- qt_canvas.cc 3 Jul 2006 01:30:49 -0000 1.10 *************** *** 68,72 **** if (p == 0) { ! QPen* pen = new QPen(); p = new roadmap_canvas_pen(); p->pen = pen; --- 68,72 ---- if (p == 0) { ! QPen* pen = new QPen(Qt::SolidLine/*Qt::DotLine*/); p = new roadmap_canvas_pen(); p->pen = pen; *************** *** 125,129 **** p.setPen(*currentPen); } ! int text_width; int text_ascent; --- 125,131 ---- p.setPen(*currentPen); } ! QFont f("Arial Bold",12); ! p.setFont(f); ! int text_width; int text_ascent; *************** *** 164,173 **** } ! p.drawText(x, y, text); } void RMapCanvas::drawStringAngle(RoadMapGuiPoint* position, int center, const char* text, int angle) { ! #if QT_NO_ROTATE if (!pixmap) { return; --- 166,175 ---- } ! p.drawText(x, y, QString::fromUtf8(text)); } void RMapCanvas::drawStringAngle(RoadMapGuiPoint* position, int center, const char* text, int angle) { ! #if !QT_NO_ROTATE if (!pixmap) { return; Index: roadmap_main.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/roadmap_main.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_main.cc 18 Nov 2005 20:19:52 -0000 1.13 --- roadmap_main.cc 3 Jul 2006 01:30:49 -0000 1.14 *************** *** 77,81 **** void roadmap_main_new(const char* title, int width, int height) { ! mainWindow = new RMapMainWindow(title); #ifdef QWS --- 77,81 ---- void roadmap_main_new(const char* title, int width, int height) { ! mainWindow = new RMapMainWindow(title,width,height); #ifdef QWS |
From: Paul F. <pg...@us...> - 2006-07-02 16:24:08
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv17541 Modified Files: roadmap_screen.c roadmap_math.c roadmap_math.h Log Message: fix code that cut's off display of distant labels. Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** roadmap_screen.c 30 Jun 2006 16:25:41 -0000 1.65 --- roadmap_screen.c 2 Jul 2006 16:24:02 -0000 1.66 *************** *** 630,639 **** int *angle_ptr = 0; RoadMapGuiPoint seg_middle; ! RoadMapGuiPoint label_cutoff; int drawn = 0; - label_cutoff.y = 0; - roadmap_log_push ("roadmap_screen_draw_square"); --- 630,638 ---- int *angle_ptr = 0; RoadMapGuiPoint seg_middle; ! RoadMapGuiPoint loweredge; ! int cutoff_dist = 0; int drawn = 0; roadmap_log_push ("roadmap_screen_draw_square"); *************** *** 648,654 **** total_length_ptr = &total_length; if (RoadMapScreen3dHorizon != 0) { ! label_cutoff.x = roadmap_canvas_height() / 2; ! label_cutoff.y = roadmap_canvas_height() / 3; roadmap_math_unproject(&label_cutoff); } #if ANGLED_LABELS --- 647,660 ---- total_length_ptr = &total_length; if (RoadMapScreen3dHorizon != 0) { ! /* arrange to not do labels further than 3/4 up the screen */ ! RoadMapGuiPoint label_cutoff; ! label_cutoff.y = roadmap_canvas_height() / 4; ! label_cutoff.x = roadmap_canvas_width() / 2; ! loweredge.x = roadmap_canvas_width() / 2; ! loweredge.y = roadmap_canvas_height(); roadmap_math_unproject(&label_cutoff); + roadmap_math_unproject(&loweredge); + cutoff_dist = roadmap_math_screen_distance + (&label_cutoff, &loweredge, MATH_DIST_SQUARED); } #if ANGLED_LABELS *************** *** 705,709 **** &seg_middle, angle_ptr); ! if (total_length_ptr && seg_middle.y > label_cutoff.y) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 711,717 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && (cutoff_dist == 0 || ! cutoff_dist > roadmap_math_screen_distance ! (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 815,819 **** &seg_middle, angle_ptr); ! if (total_length_ptr && seg_middle.y > label_cutoff.y) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 823,829 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && (cutoff_dist == 0 || ! cutoff_dist > roadmap_math_screen_distance ! (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** roadmap_math.h 1 Jul 2006 14:23:40 -0000 1.27 --- roadmap_math.h 2 Jul 2006 16:24:02 -0000 1.28 *************** *** 33,36 **** --- 33,40 ---- }; + enum { MATH_DIST_ACTUAL = 0, + MATH_DIST_SQUARED = 1 + }; + void roadmap_math_initialize (void); *************** *** 89,92 **** --- 93,99 ---- int roadmap_math_angle (const RoadMapGuiPoint *point1, const RoadMapGuiPoint *point2); + long roadmap_math_screen_distance + (const RoadMapGuiPoint *point1, const RoadMapGuiPoint *point2, + int squared); char *roadmap_math_distance_unit (void); Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** roadmap_math.c 1 Jul 2006 21:42:41 -0000 1.34 --- roadmap_math.c 2 Jul 2006 16:24:02 -0000 1.35 *************** *** 1194,1197 **** --- 1194,1218 ---- } + long roadmap_math_screen_distance + (const RoadMapGuiPoint *pt1, const RoadMapGuiPoint *pt2, int squared) { + + long dx; + long dy; + long ret; + + + dx = pt1->x - pt2->x; + dy = pt1->y - pt2->y; + + + ret = (dx * dx) + (dy * dy); + + if (squared == MATH_DIST_ACTUAL) { + ret = (long) sqrt ((double)ret); + } + + return ret; + } + int roadmap_math_distance *************** *** 1559,1564 **** int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, ! RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, ! RoadMapGuiPoint *isect) { #if USE_FLOAT /* for reference, until we're sure integer version works */ --- 1580,1585 ---- int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, ! RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, ! RoadMapGuiPoint *isect) { #if USE_FLOAT /* for reference, until we're sure integer version works */ |
From: Paul F. <pg...@us...> - 2006-07-01 21:44:44
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6714 Modified Files: roadmap_label.c Log Message: make "too many labels" log message say what it means Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_label.c 1 Jul 2006 14:23:40 -0000 1.6 --- roadmap_label.c 1 Jul 2006 21:44:41 -0000 1.7 *************** *** 170,174 **** if(RoadMapLabelCache.numlabels == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many labels on screen."); RoadMapLabelCacheFull = 1; return -1; --- 170,174 ---- if(RoadMapLabelCache.numlabels == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); RoadMapLabelCacheFull = 1; return -1; |
From: Paul F. <pg...@us...> - 2006-07-01 21:42:44
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5922 Modified Files: roadmap_math.c Log Message: fix mis-translation of float to integer. caused divide by zero. Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** roadmap_math.c 1 Jul 2006 14:23:40 -0000 1.33 --- roadmap_math.c 1 Jul 2006 21:42:41 -0000 1.34 *************** *** 520,524 **** point->y = RoadMapContext.height - (DistFromCenterY * VisibleRange) / ! abs(DistFromCenterY + VisibleRange) ; /* X distance from center of the screen */ --- 520,524 ---- point->y = RoadMapContext.height - (DistFromCenterY * VisibleRange) / ! (abs(DistFromCenterY) + VisibleRange) ; /* X distance from center of the screen */ |
From: Paul F. <pg...@us...> - 2006-07-01 14:28:17
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31432/src Modified Files: config.mk Log Message: emphasize need for version 2.4 of agg Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** config.mk 30 Jun 2006 13:46:28 -0000 1.4 --- config.mk 1 Jul 2006 14:28:11 -0000 1.5 *************** *** 61,64 **** --- 61,65 ---- # labels, but they will all be horizontal, and won't look as # nice. (for more information on AGG, see http://antigrain.com) + # RoadMap requires version 2.4 of agg. # [ Note -- currently, only GTK2 supports AGG builds. ] # AGG = YES |
From: Paul F. <pg...@us...> - 2006-07-01 14:28:15
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31432 Modified Files: README Log Message: emphasize need for version 2.4 of agg Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** README 27 Jun 2006 17:43:57 -0000 1.93 --- README 1 Jul 2006 14:28:11 -0000 1.94 *************** *** 127,133 **** files. RoadMap can be built without expat using the make option: EXPAT=NO. ! Likewise, RoadMap will use the agg library to render angled text ! when labeling streets. If you don't have agg, RoadMap will label ! with horizontal strings. Use: AGG=NO. --- 127,136 ---- files. RoadMap can be built without expat using the make option: EXPAT=NO. ! Likewise, RoadMap will use the agg library to render angled text when ! labeling streets. If you don't have agg, RoadMap will label with ! horizontal strings. Use: AGG=NO. RoadMap requires version 2.4 of the ! agg library -- 2.3 is incompatible. If your linux distribution includes ! 2.3, make sure that if you install 2.4 as well, that RoadMap finds both ! headers and libraries from 2.4. |
From: Paul F. <pg...@us...> - 2006-07-01 14:24:21
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30155 Modified Files: roadmap_friends.c roadmap_kismet.c Log Message: uninitialized variable warning suppression Index: roadmap_kismet.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_kismet.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_kismet.c 28 Jun 2006 13:46:41 -0000 1.10 --- roadmap_kismet.c 1 Jul 2006 14:24:18 -0000 1.11 *************** *** 123,129 **** int gps_mode = 0; ! char *kismet_host; - FILE *sfp; int knet = -1; int i; --- 123,129 ---- int gps_mode = 0; ! char *kismet_host = 0; /* warning suppression */ ! FILE *sfp = 0; /* warning suppression */ int knet = -1; int i; Index: roadmap_friends.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_friends.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_friends.c 28 Jun 2006 13:46:41 -0000 1.4 --- roadmap_friends.c 1 Jul 2006 14:24:18 -0000 1.5 *************** *** 260,264 **** if (strcmp (name, friends_local_name) != 0) { ! int i; int available = -1; --- 260,264 ---- if (strcmp (name, friends_local_name) != 0) { ! int i = friends_count; int available = -1; |
From: Paul F. <pg...@us...> - 2006-07-01 14:23:45
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29387 Modified Files: roadmap_label.c roadmap_math.c roadmap_math.h Log Message: introduce integer math for 3D projection/unprojection. floating point code ifdefed for now, for comparison purposes. same for new routine (roadmap_math_screen_intersect()) which checks for intersection of screen line segments. Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** roadmap_math.h 27 Jun 2006 04:03:17 -0000 1.26 --- roadmap_math.h 1 Jul 2006 14:23:40 -0000 1.27 *************** *** 120,123 **** --- 120,127 ---- RoadMapPosition *intersection); + int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, + RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, + RoadMapGuiPoint *isect); + void roadmap_math_screen_edges (RoadMapArea *area); Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** roadmap_math.c 30 Jun 2006 15:30:56 -0000 1.32 --- roadmap_math.c 1 Jul 2006 14:23:40 -0000 1.33 *************** *** 442,445 **** --- 442,446 ---- + #if USE_FLOAT /* for reference, until we're sure integer version works */ static void roadmap_math_project (RoadMapGuiPoint *point) { *************** *** 491,495 **** /* unsqueeze the X axis */ point2.x = (int) (fDistFromCenterX / ! ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); /* distance from bottom of screen */ --- 492,496 ---- /* unsqueeze the X axis */ point2.x = (int) (fDistFromCenterX / ! ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); /* distance from bottom of screen */ *************** *** 503,506 **** --- 504,572 ---- *point = point2; } + #else + static void roadmap_math_project (RoadMapGuiPoint *point) { + + /* how far away is this point along the Y axis */ + long DistFromCenterY = RoadMapContext.height - point->y; + + /* how far from the bottom of the screen is the horizon */ + long VisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; + + long DistFromCenterX; + long DistFromHorizon; + + /* make the Y coordinate converge on the horizon as the + * distance from the center goes to infinity */ + point->y = RoadMapContext.height - + (DistFromCenterY * VisibleRange) / + abs(DistFromCenterY + VisibleRange) ; + + /* X distance from center of the screen */ + DistFromCenterX = point->x - RoadMapContext.width / 2; + + /* distance from the horizon after adjusting for perspective */ + DistFromHorizon = point->y - RoadMapContext._3D_horizon; + + /* squeeze the X axis, make it a point at the horizon and + * normal sized at the bottom of the screen */ + point->x = (DistFromCenterX * DistFromHorizon) / VisibleRange + + (RoadMapContext.width / 2); + } + + void roadmap_math_unproject (RoadMapGuiPoint *point) { + + RoadMapGuiPoint point2; + + /* X distance from center of screen */ + long DistFromCenterX = point->x - RoadMapContext.width / 2; + + /* Y distance from horizon */ + long DistFromHorizon = point->y - RoadMapContext._3D_horizon; + + /* distance from bottom of screen to horizon */ + long VisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; + long DistFromBottom; + long D; + + if (RoadMapContext._3D_horizon == 0) { + return; + } + + /* unsqueeze the X axis */ + point2.x = DistFromCenterX * VisibleRange / DistFromHorizon + + RoadMapContext.width / 2; + + /* distance from bottom of screen */ + DistFromBottom = RoadMapContext.height - point->y; + + /* inverse Y squeezing formula */ + D = (DistFromBottom * VisibleRange) / ( (VisibleRange - DistFromBottom) ); + + /* center on screen */ + point2.y = RoadMapContext.height - D; + + *point = point2; + } + #endif *************** *** 1492,1495 **** --- 1558,1620 ---- } + int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, + RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, + RoadMapGuiPoint *isect) { + + #if USE_FLOAT /* for reference, until we're sure integer version works */ + double a1,b1; + double a2,b2; + + if (f1->x == t1->x) { + + a1 = 0; + b1 = f1->y; + } else { + a1 = 1.0 * (f1->y - t1->y) / (f1->x - t1->x); + b1 = f1->y - 1.0 * a1 * f1->x; + } + + if ((f2->x - t2->x) == 0) { + a2 = 0; + b2 = f2->y; + } else { + a2 = 1.0 * (f2->y - t2->y) / (f2->x - t2->x); + b2 = f2->y - 1.0 * a2 * f2->x; + } + + if (a1 == a2) return 0; + + isect->x = (int) ((b1 - b2) / (a2 - a1)); + isect->y = (int) (b1 + isect->x * a1); + #else + long a1,b1; + long a2,b2; + + if (f1->x == t1->x) { + a1 = 0; + b1 = 1024 * f1->y; + } else { + a1 = 1024 * (f1->y - t1->y) / (f1->x - t1->x); + b1 = 1024 * f1->y - a1 * f1->x; + } + + if ((f2->x - t2->x) == 0) { + a2 = 0; + b2 = 1024 * f2->y; + } else { + a2 = 1024 * (f2->y - t2->y) / (f2->x - t2->x); + b2 = 1024 * f2->y - a2 * f2->x; + } + + if (a1 == a2) return 0; + + isect->x = (b1 - b2) / (a2 - a1); + isect->y = (b1 + isect->x * a1) / 1024; + #endif + + return 1; + } + + int roadmap_math_compare_points (const RoadMapPosition *p1, Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_label.c 30 Jun 2006 16:25:41 -0000 1.5 --- roadmap_label.c 1 Jul 2006 14:23:40 -0000 1.6 *************** *** 60,95 **** } - int segment_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, - RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, - RoadMapGuiPoint *isect) { - - double a1,b1; - double a2,b2; - - if (f1->x == t1->x) { - - a1 = 0; - b1 = f1->y; - } else { - a1 = 1.0 * (f1->y - t1->y) / (f1->x - t1->x); - b1 = f1->y - 1.0 * a1 * f1->x; - } - - if ((f2->x - t2->x) == 0) { - a2 = 0; - b2 = f2->y; - } else { - a2 = 1.0 * (f2->y - t2->y) / (f2->x - t2->x); - b2 = f2->y - 1.0 * a2 * f2->x; - } - - if (a1 == a2) return 0; - - isect->x = (int) ((b1 - b2) / (a2 - a1)); - isect->y = (int) (b1 + isect->x * a1); - - return 1; - } - static int point_in_bbox( RoadMapGuiPoint *p, RoadMapGuiRect *bb) { --- 60,63 ---- *************** *** 101,104 **** --- 69,73 ---- } + /* doesn't check for one completely inside the other -- just intersection */ static int poly_overlap (labelCacheMemberObj *c1, labelCacheMemberObj *c2) { *************** *** 109,113 **** for (ai = 0; ai < 4; ai++) { for (bi = 0; bi < 4; bi++) { ! if (segment_intersect( &a[ai], &a[(ai+1)%4], &b[bi], &b[(bi+1)%4], &isect)) { if (point_in_bbox(&isect, &c1->bbox) && --- 78,82 ---- for (ai = 0; ai < 4; ai++) { for (bi = 0; bi < 4; bi++) { ! if (roadmap_math_screen_intersect( &a[ai], &a[(ai+1)%4], &b[bi], &b[(bi+1)%4], &isect)) { if (point_in_bbox(&isect, &c1->bbox) && |
From: Paul F. <pg...@us...> - 2006-06-30 16:25:46
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25195 Modified Files: roadmap_screen.c roadmap_label.c Log Message: implement proper label cutoff limit in 3D mode Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_label.c 30 Jun 2006 13:30:33 -0000 1.4 --- roadmap_label.c 30 Jun 2006 16:25:41 -0000 1.5 *************** *** 194,211 **** if (RoadMapLabelCacheFull) return -1; - /* TEMPORARY -- this is a poor attempt to limit the number - * of labels we consider for inclusion on the screen. in 3D - * mode this turns off labels from the upper third of the screen - * approximately -- i need to find the right transform to make - * this "right". - */ - /* if (point->y < roadmap_canvas_height()/10) { doesn't work */ - if (point->y < -450) { - return -1; - } - if (featuresize < roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { - return -1; } --- 194,199 ---- Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** roadmap_screen.c 30 Jun 2006 13:27:17 -0000 1.64 --- roadmap_screen.c 30 Jun 2006 16:25:41 -0000 1.65 *************** *** 630,636 **** --- 630,639 ---- int *angle_ptr = 0; RoadMapGuiPoint seg_middle; + RoadMapGuiPoint label_cutoff; int drawn = 0; + label_cutoff.y = 0; + roadmap_log_push ("roadmap_screen_draw_square"); *************** *** 644,649 **** RoadMapScreenLabels) { total_length_ptr = &total_length; #if ANGLED_LABELS ! if (RoadMapScreen3dHorizon == 0) { angle_ptr = ∠ } --- 647,657 ---- RoadMapScreenLabels) { total_length_ptr = &total_length; + if (RoadMapScreen3dHorizon != 0) { + label_cutoff.x = roadmap_canvas_height() / 2; + label_cutoff.y = roadmap_canvas_height() / 3; + roadmap_math_unproject(&label_cutoff); + } #if ANGLED_LABELS ! else { angle_ptr = ∠ } *************** *** 697,701 **** &seg_middle, angle_ptr); ! if (total_length_ptr) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 705,709 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && seg_middle.y > label_cutoff.y) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 807,812 **** &seg_middle, angle_ptr); ! if (total_length_ptr) { ! PluginLine l = {ROADMAP_PLUGIN_ID, real_line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 815,819 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && seg_middle.y > label_cutoff.y) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); |
From: Paul F. <pg...@us...> - 2006-06-30 15:31:01
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3238 Modified Files: roadmap_math.c Log Message: reformat roadmap_math_un/project() for 80 column lines. makes the comments visible. also move the two routines together. Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** roadmap_math.c 27 Jun 2006 04:03:17 -0000 1.31 --- roadmap_math.c 30 Jun 2006 15:30:56 -0000 1.32 *************** *** 444,458 **** static void roadmap_math_project (RoadMapGuiPoint *point) { ! double fDistFromCenterY = RoadMapContext.height - point->y; // how far away is this point along the Y axis ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; // how far from the bottom of the screen is the horizon double fDistFromCenterX; double fDistFromHorizon; ! point->y = (int) (RoadMapContext.height - fDistFromCenterY / ( fabs(fDistFromCenterY / fVisibleRange) + 1 )); // make the Y coordinate converge on the horizon as the distance from the center goes to infinity ! fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of the screen ! fDistFromHorizon = point->y - RoadMapContext._3D_horizon; // distance from the horizon after adjusting for perspective ! point->x = (int) (fDistFromCenterX * ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); // squeeze the X axis, make it a point at the horizon and normal sized at the bottom of the screen } --- 444,505 ---- static void roadmap_math_project (RoadMapGuiPoint *point) { ! /* how far away is this point along the Y axis */ ! double fDistFromCenterY = RoadMapContext.height - point->y; ! ! /* how far from the bottom of the screen is the horizon */ ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! double fDistFromCenterX; double fDistFromHorizon; ! /* make the Y coordinate converge on the horizon as the ! * distance from the center goes to infinity */ ! point->y = (int) (RoadMapContext.height - fDistFromCenterY / ! ( fabs(fDistFromCenterY / fVisibleRange) + 1 )); ! /* X distance from center of the screen */ ! fDistFromCenterX = point->x - RoadMapContext.width / 2; ! /* distance from the horizon after adjusting for perspective */ ! fDistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* squeeze the X axis, make it a point at the horizon and ! * normal sized at the bottom of the screen */ ! point->x = (int) (fDistFromCenterX * ( fDistFromHorizon / fVisibleRange ) ! + RoadMapContext.width / 2); ! } ! ! void roadmap_math_unproject (RoadMapGuiPoint *point) { ! ! RoadMapGuiPoint point2; ! ! /* X distance from center of screen */ ! double fDistFromCenterX = point->x - RoadMapContext.width / 2; ! ! /* Y distance from horizon */ ! double fDistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* distance from bottom of screen to horizon */ ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! double fDistFromBottom; ! double fD; ! ! if (RoadMapContext._3D_horizon == 0) { ! return; ! } ! ! /* unsqueeze the X axis */ ! point2.x = (int) (fDistFromCenterX / ! ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); ! ! /* distance from bottom of screen */ ! fDistFromBottom = RoadMapContext.height - point->y; ! /* inverse Y squeezing formula */ ! fD = fDistFromBottom / ( 1.0 - fDistFromBottom / fVisibleRange); ! ! /* center on screen */ ! point2.y = (int) (RoadMapContext.height - fD); ! ! *point = point2; } *************** *** 978,1004 **** - void roadmap_math_unproject (RoadMapGuiPoint *point) { - - if (RoadMapContext._3D_horizon) { - - RoadMapGuiPoint point2; - - double fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of screen - double fDistFromHorizon = point->y - RoadMapContext._3D_horizon; // Y distance from horizon - double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; // distance from bottom of screen to horizon - double fDistFromBottom; - double fD; - - point2.x = (int) (fDistFromCenterX / ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); // unsqueeze the X axis - - fDistFromBottom = RoadMapContext.height - point->y; // distance from bottom of screen - fD = fDistFromBottom / ( 1.0 - fDistFromBottom / fVisibleRange); // inverse Y squeezing formula - - point2.y = (int) (RoadMapContext.height - fD); // center on screen - - *point = point2; - } - } - void roadmap_math_to_position (const RoadMapGuiPoint *point, --- 1025,1028 ---- |
From: Paul F. <pg...@us...> - 2006-06-30 13:46:31
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27649 Modified Files: config.mk Log Message: spelling fix Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config.mk 30 Jun 2006 13:43:51 -0000 1.3 --- config.mk 30 Jun 2006 13:46:28 -0000 1.4 *************** *** 38,42 **** # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in # some Familiar builds), set QT_NO_ROTATE ! # QT_NO_ROTATE = yes # RoadMap uses the "expat" library in order to read and write xml --- 38,42 ---- # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in # some Familiar builds), set QT_NO_ROTATE ! # QT_NO_ROTATE = YES # RoadMap uses the "expat" library in order to read and write xml |
From: Paul F. <pg...@us...> - 2006-06-30 13:43:54
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv26474 Modified Files: config.mk Log Message: make it easier to build QT without support for angled labels, since some distributions install QT without rotation support. Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.mk 27 Jun 2006 17:43:57 -0000 1.2 --- config.mk 30 Jun 2006 13:43:51 -0000 1.3 *************** *** 18,22 **** # Add any other special local CFLAGS values here ! CFLAGS = # if you know you need other libraries for your build, you can --- 18,22 ---- # Add any other special local CFLAGS values here ! CFLAGS = # if you know you need other libraries for your build, you can *************** *** 34,38 **** # if you select QT or QPE above, you might also want to set # QTDIR here: ! QTDIR=/usr # RoadMap uses the "expat" library in order to read and write xml --- 34,42 ---- # if you select QT or QPE above, you might also want to set # QTDIR here: ! QTDIR = /usr ! # if you are using a build of QT without the QPainter::rotate() ! # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in ! # some Familiar builds), set QT_NO_ROTATE ! # QT_NO_ROTATE = yes # RoadMap uses the "expat" library in order to read and write xml |
From: Paul F. <pg...@us...> - 2006-06-30 13:41:48
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24481 Modified Files: options.mk Log Message: make it easier to build QT without support for angled labels, since some distributions install QT without rotation support. Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** options.mk 27 Jun 2006 17:43:57 -0000 1.2 --- options.mk 30 Jun 2006 13:41:43 -0000 1.3 *************** *** 97,100 **** --- 97,103 ---- # rotation support in QT/QPE + ifeq ($(strip $(QT_NO_ROTATE)),YES) + CFLAGS += -DQT_NO_ROTATE -UANGLED_LABELS + else ifeq ($(strip $(DESKTOP)),QT) CFLAGS += -DANGLED_LABELS=1 *************** *** 103,106 **** --- 106,110 ---- CFLAGS += -DANGLED_LABELS=1 endif + endif |
From: Paul F. <pg...@us...> - 2006-06-30 13:41:48
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24481/qt Modified Files: qt_canvas.cc Log Message: make it easier to build QT without support for angled labels, since some distributions install QT without rotation support. Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** qt_canvas.cc 27 Jun 2006 17:43:58 -0000 1.8 --- qt_canvas.cc 30 Jun 2006 13:41:44 -0000 1.9 *************** *** 115,119 **** } ! void RMapCanvas::drawString(RoadMapGuiPoint* position, int corner, const char* text) { if (!pixmap) { return; --- 115,120 ---- } ! void RMapCanvas::drawString(RoadMapGuiPoint* position, ! int corner, const char* text) { if (!pixmap) { return; *************** *** 168,171 **** --- 169,173 ---- void RMapCanvas::drawStringAngle(RoadMapGuiPoint* position, int center, const char* text, int angle) { + #if QT_NO_ROTATE if (!pixmap) { return; *************** *** 183,186 **** --- 185,189 ---- p.rotate((double)angle); p.drawText(0, 0, QString::fromUtf8(text)); + #endif } |
From: Paul F. <pg...@us...> - 2006-06-30 13:31:09
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20540 Modified Files: roadmap_label.c roadmap_label.h Log Message: modify maintenance of the prospective label cache -- don't allocate all at once, and eliminate rescans of eliminated entries. finish label-collision detection code -- lets labels exist side by side on diagonal streets, which simply bounding box check wouldn't do. Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_label.c 27 Jun 2006 17:43:57 -0000 1.3 --- roadmap_label.c 30 Jun 2006 13:30:33 -0000 1.4 *************** *** 28,31 **** --- 28,33 ---- */ + #include <stdlib.h> + #include "roadmap_config.h" #include "roadmap_math.h" *************** *** 58,61 **** --- 60,124 ---- } + int segment_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, + RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, + RoadMapGuiPoint *isect) { + + double a1,b1; + double a2,b2; + + if (f1->x == t1->x) { + + a1 = 0; + b1 = f1->y; + } else { + a1 = 1.0 * (f1->y - t1->y) / (f1->x - t1->x); + b1 = f1->y - 1.0 * a1 * f1->x; + } + + if ((f2->x - t2->x) == 0) { + a2 = 0; + b2 = f2->y; + } else { + a2 = 1.0 * (f2->y - t2->y) / (f2->x - t2->x); + b2 = f2->y - 1.0 * a2 * f2->x; + } + + if (a1 == a2) return 0; + + isect->x = (int) ((b1 - b2) / (a2 - a1)); + isect->y = (int) (b1 + isect->x * a1); + + return 1; + } + + static int point_in_bbox( RoadMapGuiPoint *p, RoadMapGuiRect *bb) { + + if ((p->x < bb->minx) || (p->x > bb->maxx) || + (p->y > bb->maxy) || (p->y < bb->miny)) + return 0; + + return 1; + } + + static int poly_overlap (labelCacheMemberObj *c1, labelCacheMemberObj *c2) { + + RoadMapGuiPoint *a = c1->poly; + RoadMapGuiPoint *b = c2->poly; + RoadMapGuiPoint isect; + int ai, bi; + for (ai = 0; ai < 4; ai++) { + for (bi = 0; bi < 4; bi++) { + if (segment_intersect( &a[ai], &a[(ai+1)%4], + &b[bi], &b[(bi+1)%4], &isect)) { + if (point_in_bbox(&isect, &c1->bbox) && + point_in_bbox(&isect, &c2->bbox)) + return 1; + } + } + } + + return 0; + } + static void compute_bbox(RoadMapGuiPoint *poly, RoadMapGuiRect *bbox) { *************** *** 75,87 **** ! static RoadMapGuiPoint get_metrics(RoadMapGuiPoint *p, RoadMapGuiRect *rect, ! int ox, int oy, int angle, ! RoadMapGuiRect *bbox) { RoadMapGuiPoint q; int x1=0, y1=0; ! RoadMapGuiPoint poly[4]; int w, h; int buffer = 0; int lines = 2; w = rect->maxx - rect->minx; --- 138,151 ---- ! static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect) { RoadMapGuiPoint q; int x1=0, y1=0; ! RoadMapGuiPoint *poly = c->poly; int w, h; int buffer = 0; int lines = 2; + int angle = c->angle; + RoadMapGuiPoint *p = &c->point; w = rect->maxx - rect->minx; *************** *** 89,94 **** /* position CC */ ! x1 = -(int)(w/2.0) + ox; ! y1 = (int)(h/2.0) + oy; q.x = x1 - rect->minx; --- 153,158 ---- /* position CC */ ! x1 = -(int)(w/2.0) + 0; // ox; ! y1 = (int)(h/2.0) + 0; // oy; q.x = x1 - rect->minx; *************** *** 115,121 **** lines = 4; ! /* roadmap_canvas_draw_multiple_lines(1, &lines, poly); */ ! compute_bbox(poly, bbox); return q; --- 179,185 ---- lines = 4; ! /* roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); */ ! compute_bbox(poly, &c->bbox); return q; *************** *** 130,133 **** --- 194,208 ---- if (RoadMapLabelCacheFull) return -1; + /* TEMPORARY -- this is a poor attempt to limit the number + * of labels we consider for inclusion on the screen. in 3D + * mode this turns off labels from the upper third of the screen + * approximately -- i need to find the right transform to make + * this "right". + */ + /* if (point->y < roadmap_canvas_height()/10) { doesn't work */ + if (point->y < -450) { + return -1; + } + if (featuresize < roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { *************** *** 136,139 **** --- 211,215 ---- } + if(RoadMapLabelCache.numlabels == MAX_LABELS) { roadmap_log (ROADMAP_WARNING, "Too many labels on screen."); *************** *** 142,146 **** } ! cachePtr = &(RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]); cachePtr->featuresize = featuresize; --- 218,227 ---- } ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]; ! if (!cachePtr) { ! cachePtr = malloc (sizeof (*cachePtr)); ! roadmap_check_allocated (cachePtr); ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels] = cachePtr; ! } cachePtr->featuresize = featuresize; *************** *** 165,170 **** RoadMapGuiPoint p; RoadMapGuiRect r; ! int label_offsetx = 0; ! int label_offsety = 0; const char *text; --- 246,251 ---- RoadMapGuiPoint p; RoadMapGuiRect r; ! // int label_offsetx = 0; ! // int label_offsety = 0; const char *text; *************** *** 177,186 **** PluginStreetProperties properties; ! cachePtr = &(RoadMapLabelCache.labels[l]); roadmap_plugin_get_street_properties (&cachePtr->line, &properties); if (!properties.street || !*properties.street) { ! continue; } --- 258,267 ---- PluginStreetProperties properties; ! cachePtr = RoadMapLabelCache.labels[l]; roadmap_plugin_get_street_properties (&cachePtr->line, &properties); if (!properties.street || !*properties.street) { ! goto recycle; } *************** *** 194,205 **** r.maxy = ascent + descent + 1; - /* - label_offsety += MS_NINT(((bbox[5] + bbox[1]) + size) / 2); - label_offsetx += MS_NINT(bbox[0] / 2); - */ - /* text is too long for this feature */ if ((width >> 2) > cachePtr->featuresize) { ! continue; } --- 275,281 ---- r.maxy = ascent + descent + 1; /* text is too long for this feature */ if ((width >> 2) > cachePtr->featuresize) { ! goto recycle; } *************** *** 218,226 **** cachePtr->angle -= 90; ! p = get_metrics (&(cachePtr->point), &r, label_offsetx, label_offsety, ! cachePtr->angle, &cachePtr->bbox); } else { ! /* Text will be horizontal, so bypass a lot of math. ! * Compensate for eventual centering of text. */ p = cachePtr->point; cachePtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; --- 294,302 ---- cachePtr->angle -= 90; ! // p = get_metrics (&(cachePtr->point), &r, cachePtr->angle, &cachePtr->bbox); ! p = get_metrics (cachePtr, &r); } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) */ p = cachePtr->point; cachePtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; *************** *** 231,260 **** for(i=0; i<l; i++) { /* compare against rendered label */ ! if(RoadMapLabelCache.labels[i].status == 1) { ! /* compare bounding polygons and check for duplicates */ ! /* MIN_DISTANCE */ ! if(roadmap_plugin_same_street(&cachePtr->street, ! &RoadMapLabelCache.labels[i].street)) { ! /* label is a duplicate */ ! cachePtr->status = 0; ! break; ! } - if(rect_overlap (&RoadMapLabelCache.labels[i].bbox, - &cachePtr->bbox)) { cachePtr->status = 0; break; ! } } } ! /* imagePolyline(img, cachePtr->poly, 1, 0, 0); */ ! ! if(!cachePtr->status) continue; /* next label */ ! roadmap_canvas_draw_string_angle (&p, &cachePtr->point, cachePtr->angle, text); } /* next label */ --- 307,353 ---- for(i=0; i<l; i++) { /* compare against rendered label */ ! /* compare bounding polygons and check for duplicates */ ! if(roadmap_plugin_same_street(&cachePtr->street, ! &RoadMapLabelCache.labels[i]->street)) { ! /* label is a duplicate */ ! cachePtr->status = 0; ! break; ! } ! ! ! if(rect_overlap (&RoadMapLabelCache.labels[i]->bbox, ! &cachePtr->bbox)) { ! ! /* if labels are horizontal, bbox check is sufficient. else... */ ! if(!angles || ! poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; ! } } } ! if(!cachePtr->status) { ! recycle: ! /* move us out of the "under consideration" group */ ! if (l < RoadMapLabelCache.numlabels - 1) { ! labelCacheMemberObj * tmpPtr = cachePtr; ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1]; ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1] = tmpPtr;; ! RoadMapLabelCache.labels[l--] = cachePtr; ! RoadMapLabelCache.numlabels--; ! } continue; /* next label */ + } ! if (angles) { ! roadmap_canvas_draw_string_angle (&p, &cachePtr->point, cachePtr->angle, text); + } else { + roadmap_canvas_draw_string + (&cachePtr->point, ROADMAP_CANVAS_CENTER, text); + } } /* next label */ Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_label.h 26 Jun 2006 19:59:53 -0000 1.1 --- roadmap_label.h 30 Jun 2006 13:30:39 -0000 1.2 *************** *** 30,34 **** #include "roadmap_gui.h" ! #define MAX_LABELS 500 typedef struct { --- 30,34 ---- #include "roadmap_gui.h" ! #define MAX_LABELS 700 typedef struct { *************** *** 39,52 **** PluginStreet street; - int angle; /* degrees */ RoadMapGuiPoint point; /* label point */ RoadMapGuiRect bbox; /* label bounding box */ ! int status; /* has this label been drawn or not */ } labelCacheMemberObj; typedef struct { ! labelCacheMemberObj labels[MAX_LABELS]; int numlabels; } labelCacheObj; --- 39,53 ---- PluginStreet street; RoadMapGuiPoint point; /* label point */ RoadMapGuiRect bbox; /* label bounding box */ + RoadMapGuiPoint poly[4]; ! short angle; /* degrees */ ! short status; /* has this label been drawn or not */ } labelCacheMemberObj; typedef struct { ! labelCacheMemberObj *labels[MAX_LABELS]; int numlabels; } labelCacheObj; |
From: Paul F. <pg...@us...> - 2006-06-30 13:27:22
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19748 Modified Files: roadmap_screen.c Log Message: enable horizontal street labels in 3D mode. (also eliminate tabs from last commit -- so there are a lot of whitespace changes, i'm afraid.) Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** roadmap_screen.c 27 Jun 2006 04:03:17 -0000 1.63 --- roadmap_screen.c 30 Jun 2006 13:27:17 -0000 1.64 *************** *** 299,305 **** if (length > longest_segent) { longest_segent = length; ! if (angle) { *angle = roadmap_math_azymuth(&last_midposition, &midposition); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 299,305 ---- if (length > longest_segent) { longest_segent = length; ! if (angle) { *angle = roadmap_math_azymuth(&last_midposition, &midposition); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 350,356 **** if (length > longest_segent) { longest_segent = length; ! if (angle) { *angle = roadmap_math_azymuth(&last_midposition, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 350,356 ---- if (length > longest_segent) { longest_segent = length; ! if (angle) { *angle = roadmap_math_azymuth(&last_midposition, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 414,420 **** *total_length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! if (angle) { *angle = roadmap_math_azymuth(from, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 414,420 ---- *total_length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! if (angle) { *angle = roadmap_math_azymuth(from, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 640,650 **** if (layer_pen == NULL) return 0; ! if (!RoadMapScreen3dHorizon && ! (pen_index == 0) && /* we do labels only for the first pen */ ! !RoadMapScreenDragging && ! RoadMapScreenLabels) { total_length_ptr = &total_length; #if ANGLED_LABELS ! angle_ptr = ∠ #endif } --- 640,651 ---- if (layer_pen == NULL) return 0; ! if ((pen_index == 0) && /* we do labels only for the first pen */ ! !RoadMapScreenDragging && ! RoadMapScreenLabels) { total_length_ptr = &total_length; #if ANGLED_LABELS ! if (RoadMapScreen3dHorizon == 0) { ! angle_ptr = ∠ ! } #endif } *************** *** 694,699 **** (&from, &to, fully_visible, &from, first_shape, last_shape, roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); ! if (total_length_ptr) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; --- 695,700 ---- (&from, &to, fully_visible, &from, first_shape, last_shape, roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); ! if (total_length_ptr) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; *************** *** 804,808 **** (&from, &to, fully_visible, &from, first_shape, last_shape, roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); if (total_length_ptr) { --- 805,809 ---- (&from, &to, fully_visible, &from, first_shape, last_shape, roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); if (total_length_ptr) { *************** *** 977,982 **** for (k = 0; k < max_pen; ++k) { ! static int *layers = NULL; ! static int layers_size = 0; int layer_count; int pen_type = k; --- 978,983 ---- for (k = 0; k < max_pen; ++k) { ! static int *layers = NULL; ! static int layers_size = 0; int layer_count; int pen_type = k; *************** *** 984,1000 **** roadmap_screen_reset_square_mask(); ! if (layers == NULL) { ! layers_size = roadmap_layer_max_defined(); ! layers = (int *)calloc (layers_size, sizeof(int)); ! roadmap_check_allocated(layers); ! } ! layer_count = roadmap_layer_visible_lines (layers, layers_size, k); if (!layer_count) continue; ! for (j = count - 1; j >= 0; --j) { ! roadmap_screen_repaint_square (in_view[j], pen_type, ! layer_count, layers); ! } } } --- 985,1001 ---- roadmap_screen_reset_square_mask(); ! if (layers == NULL) { ! layers_size = roadmap_layer_max_defined(); ! layers = (int *)calloc (layers_size, sizeof(int)); ! roadmap_check_allocated(layers); ! } ! layer_count = roadmap_layer_visible_lines (layers, layers_size, k); if (!layer_count) continue; ! for (j = count - 1; j >= 0; --j) { ! roadmap_screen_repaint_square (in_view[j], pen_type, ! layer_count, layers); ! } } } *************** *** 1003,1009 **** roadmap_screen_flush_lines (); roadmap_screen_flush_points (); ! ! if ((RoadMapScreen3dHorizon == 0) && !RoadMapScreenDragging) { ! roadmap_label_draw_cache (ANGLED_LABELS); } } --- 1004,1011 ---- roadmap_screen_flush_lines (); roadmap_screen_flush_points (); ! ! if (!RoadMapScreenDragging) { ! roadmap_label_draw_cache ! (ANGLED_LABELS && RoadMapScreen3dHorizon == 0); } } *************** *** 1032,1036 **** roadmap_log_pop (); ! dbg_time_end(DBG_TIME_FULL); } --- 1034,1038 ---- roadmap_log_pop (); ! dbg_time_end(DBG_TIME_FULL); } |
From: Paul F. <pg...@us...> - 2006-06-29 01:29:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2060 Modified Files: roadmap_log.c Log Message: implement the unix version of the benchmarking metrics in the ROADMAP_DBG_TIME ifdef. (enable with "DBG_TIME = YES" in config.mk, and observe values with debugger.) Index: roadmap_log.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_log.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** roadmap_log.c 26 Jun 2006 17:41:35 -0000 1.15 --- roadmap_log.c 29 Jun 2006 01:29:29 -0000 1.16 *************** *** 266,269 **** --- 266,270 ---- #ifdef __WIN32 + void dbg_time_start(int type) { dbg_time_tmp[type] = GetTickCount(); *************** *** 275,285 **** #else void dbg_time_start(int type) { ! dbg_time_tmp[type] = 0; } void dbg_time_end(int type) { ! dbg_time_rec[type] += 0; } --- 276,297 ---- #else + #include <time.h> + #include <sys/time.h> + + unsigned long tv_to_msec(struct timeval *tv) + { + return (tv->tv_sec & 0xffff) * 1000 + tv->tv_usec/1000; + } void dbg_time_start(int type) { ! struct timeval tv; ! gettimeofday(&tv, NULL); ! dbg_time_tmp[type] = tv_to_msec(&tv); } void dbg_time_end(int type) { ! struct timeval tv; ! gettimeofday(&tv, NULL); ! dbg_time_rec[type] += tv_to_msec(&tv) - dbg_time_tmp[type]; } |