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: <pg...@us...> - 2015-06-01 14:06:04
|
Revision: 2829 http://sourceforge.net/p/roadmap/code/2829 Author: pgf Date: 2015-06-01 14:06:01 +0000 (Mon, 01 Jun 2015) Log Message: ----------- roadmap_screen: don't try and display missing sprite Modified Paths: -------------- trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-06-01 14:05:58 UTC (rev 2828) +++ trunk/roadmap/src/roadmap_screen.c 2015-06-01 14:06:01 UTC (rev 2829) @@ -1299,7 +1299,7 @@ roadmap_place_point(place, &pos); roadmap_math_coordinate (&pos, &guipoint); - if (layer_sprite) { + if (layer_sprite && layer_sprite[0]) { /* the label's guipoint will be rotated later. don't * want to rotate it twice. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-01 14:06:00
|
Revision: 2828 http://sourceforge.net/p/roadmap/code/2828 Author: pgf Date: 2015-06-01 14:05:58 +0000 (Mon, 01 Jun 2015) Log Message: ----------- roadmap_layer: fix sprite and declutter default layer properties Modified Paths: -------------- trunk/roadmap/src/roadmap_layer.c Modified: trunk/roadmap/src/roadmap_layer.c =================================================================== --- trunk/roadmap/src/roadmap_layer.c 2015-06-01 03:14:53 UTC (rev 2827) +++ trunk/roadmap/src/roadmap_layer.c 2015-06-01 14:05:58 UTC (rev 2828) @@ -883,15 +883,15 @@ layer->declutter.category = layernames[i]; layer->declutter.name = "Declutter"; - roadmap_config_declare (class_config, &layer->declutter, "20248000000"); + roadmap_config_declare (class_config, &layer->declutter, "99999"); layer->label_declutter.category = layernames[i]; layer->label_declutter.name = "LabelDeclutter"; - roadmap_config_declare (class_config, &layer->label_declutter, "1000"); + roadmap_config_declare (class_config, &layer->label_declutter, "99999"); layer->sprite.category = layernames[i]; layer->sprite.name = "Sprite"; - roadmap_config_declare (class_config, &layer->sprite, "Amenity"); + /* no default Sprite */ layer->speed.category = layernames[i]; layer->speed.name = "Speed"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-01 03:14:55
|
Revision: 2827 http://sourceforge.net/p/roadmap/code/2827 Author: pgf Date: 2015-06-01 03:14:53 +0000 (Mon, 01 Jun 2015) Log Message: ----------- buildplace: fix non-shapefile-enabled builds Modified Paths: -------------- trunk/roadmap/src/buildplace_main.c Modified: trunk/roadmap/src/buildplace_main.c =================================================================== --- trunk/roadmap/src/buildplace_main.c 2015-06-01 03:09:49 UTC (rev 2826) +++ trunk/roadmap/src/buildplace_main.c 2015-06-01 03:14:53 UTC (rev 2827) @@ -83,7 +83,6 @@ }; -#if ROADMAP_USE_SHAPEFILES static RoadMapString str2dict(BuildMapDictionary d, const char *string) { @@ -94,7 +93,6 @@ return buildmap_dictionary_add(d, (char *) string, strlen(string)); } -#endif /* ROADMAP_USE_SHAPEFILES */ static void @@ -152,7 +150,6 @@ } -#if ROADMAP_USE_SHAPEFILES static int dsg2layer(const char *dsg) { @@ -162,7 +159,6 @@ ep = hsearch(e, FIND); return ep ? *(int *) ep->data : 0; } -#endif static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-06-01 03:09:52
|
Revision: 2826 http://sourceforge.net/p/roadmap/code/2826 Author: pgf Date: 2015-06-01 03:09:49 +0000 (Mon, 01 Jun 2015) Log Message: ----------- buildmap_osm_main: fix argc accounting Modified Paths: -------------- trunk/roadmap/src/buildmap_osm_main.c Modified: trunk/roadmap/src/buildmap_osm_main.c =================================================================== --- trunk/roadmap/src/buildmap_osm_main.c 2015-05-31 23:08:49 UTC (rev 2825) +++ trunk/roadmap/src/buildmap_osm_main.c 2015-06-01 03:09:49 UTC (rev 2826) @@ -912,7 +912,7 @@ } else if (*inputfile && *BuildMapFileName) { int r; - if (argc > 0) usage_err("too many arguments"); + if (argc > 1) usage_err("too many arguments"); r = buildmap_osm_text_process_file(inputfile, BuildMapFileName); exit(r); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:52
|
Revision: 2825 http://sourceforge.net/p/roadmap/code/2825 Author: pgf Date: 2015-05-31 23:08:49 +0000 (Sun, 31 May 2015) Log Message: ----------- config.mk -- enable the google route fetch Modified Paths: -------------- trunk/roadmap/src/config.mk Modified: trunk/roadmap/src/config.mk =================================================================== --- trunk/roadmap/src/config.mk 2015-05-31 23:08:46 UTC (rev 2824) +++ trunk/roadmap/src/config.mk 2015-05-31 23:08:49 UTC (rev 2825) @@ -178,6 +178,7 @@ # You can add any other special local CFLAGS values here # e.g., CFLAGS += -DWGET_GOOGLE_ROUTE # CFLAGS += +CFLAGS += -DWGET_GOOGLE_ROUTE # If you know you need other libraries for your build, you can # add those here as well. For example: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:49
|
Revision: 2824 http://sourceforge.net/p/roadmap/code/2824 Author: pgf Date: 2015-05-31 23:08:46 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_label: fix longstanding bug with label overlap detection Modified Paths: -------------- trunk/roadmap/src/roadmap_label.c Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:43 UTC (rev 2823) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:46 UTC (rev 2824) @@ -385,7 +385,7 @@ int width, ascent, descent; RoadMapGuiRect r; RoadMapGuiPoint midpt; - short aang; + short aang, bang; roadmap_label *cPtr, *ocPtr, *ncPtr; int whichlist; #define OLDLIST 0 @@ -653,22 +653,18 @@ break; } - /* if labels are "almost" horizontal, the bbox check is + /* if both labels are "almost" horizontal, the bbox check is * close enough. (in addition, the line intersector * has trouble with flat or steep lines.) */ aang = abs(cPtr->angle); - if (aang < 4 || aang > 86) { + bang = abs(ocPtr->angle); + if ((aang < 4 || aang > 86) && + (bang < 4 || bang > 86)) { cannot_label = 3; break; } - aang = abs(ocPtr->angle); - if (aang < 4 || aang > 86) { - cannot_label = 4; - break; - } - /* otherwise we do the full poly check */ if (poly_overlap (ocPtr, cPtr)) { cannot_label = 5; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:45
|
Revision: 2823 http://sourceforge.net/p/roadmap/code/2823 Author: pgf Date: 2015-05-31 23:08:43 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_screen: fix how place sprites and labels rotate with screen Modified Paths: -------------- trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:40 UTC (rev 2822) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:43 UTC (rev 2823) @@ -1300,8 +1300,13 @@ roadmap_place_point(place, &pos); roadmap_math_coordinate (&pos, &guipoint); if (layer_sprite) { - roadmap_sprite_draw (layer_sprite, &guipoint, 0); - roadmap_math_rotate_coordinates (1, &guipoint); + /* the label's guipoint will be rotated later. don't + * want to rotate it twice. + */ + RoadMapGuiPoint newguipoint = guipoint; + roadmap_math_rotate_coordinates (1, &newguipoint); + roadmap_sprite_draw (layer_sprite, &newguipoint, + -roadmap_math_get_orientation()); } if (labels_visible && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:42
|
Revision: 2822 http://sourceforge.net/p/roadmap/code/2822 Author: pgf Date: 2015-05-31 23:08:40 +0000 (Sun, 31 May 2015) Log Message: ----------- labels: make sure we calculate text extents using the right font size Modified Paths: -------------- trunk/roadmap/src/roadmap_display.c trunk/roadmap/src/roadmap_label.c trunk/roadmap/src/roadmap_screen.c trunk/roadmap/src/roadmap_screen.h trunk/roadmap/src/roadmap_sprite.c Modified: trunk/roadmap/src/roadmap_display.c =================================================================== --- trunk/roadmap/src/roadmap_display.c 2015-05-31 23:08:37 UTC (rev 2821) +++ trunk/roadmap/src/roadmap_display.c 2015-05-31 23:08:40 UTC (rev 2822) @@ -303,7 +303,7 @@ roadmap_log_push ("roadmap_display_sign"); roadmap_screen_text_extents - (ROADMAP_TEXT_SIGNS, sign->content, RoadMapDisplayFontSize, + (ROADMAP_TEXT_SIGNS, sign->content, RoadMapDisplayFontSize, NULL, &width, &ascent, &descent, NULL); width += 8; /* Keep some room around the text. */ @@ -630,7 +630,7 @@ } roadmap_screen_text_extents - (ROADMAP_TEXT_SIGNS, text, RoadMapDisplayFontSize, + (ROADMAP_TEXT_SIGNS, text, RoadMapDisplayFontSize, NULL, &width, &ascent, &descent, NULL); canvas_width = roadmap_canvas_width(); Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:37 UTC (rev 2821) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:40 UTC (rev 2822) @@ -537,7 +537,7 @@ if (cPtr->bbox.minx > cPtr->bbox.maxx) { roadmap_screen_text_extents (ROADMAP_TEXT_LABELS, cPtr->text, - RoadMapLabelFontSize , + RoadMapLabelFontSize , cPtr->pen, &width, &ascent, &descent, &can_tilt); angles = angles && can_tilt; @@ -547,7 +547,7 @@ /* text is too long for this feature */ /* (4 times longer than feature) */ - if ((width * width / 16) > cPtr->featuresize_sq) { + if (!cPtr->is_place && (width * width / 16) > cPtr->featuresize_sq) { /* Keep this one in the cache as the feature size may change * in the next run. Keeping it is cheaper than looking it * up again. Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:37 UTC (rev 2821) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:40 UTC (rev 2822) @@ -2340,11 +2340,12 @@ * @param can_tilt */ void roadmap_screen_text_extents (int id, const char *text, int size, - int *width, int *ascent, int *descent, int *can_tilt) { + RoadMapPen pen, int *width, int *ascent, int *descent, int *can_tilt) { if ((RoadMapLineFontSelect & id) != 0) { roadmap_linefont_extents (text, size, width, ascent, descent, can_tilt); } else { + if (pen) roadmap_canvas_select_pen(pen); roadmap_canvas_get_text_extents (text, size, width, ascent, descent, can_tilt); } Modified: trunk/roadmap/src/roadmap_screen.h =================================================================== --- trunk/roadmap/src/roadmap_screen.h 2015-05-31 23:08:37 UTC (rev 2821) +++ trunk/roadmap/src/roadmap_screen.h 2015-05-31 23:08:40 UTC (rev 2822) @@ -82,7 +82,7 @@ (int id, RoadMapGuiPoint *center, int theta, int size, const char *text); void roadmap_screen_text_extents - (int id, const char *text, int size, + (int id, const char *text, int size, RoadMapPen pen, int *width, int *ascent, int *descent, int *can_tilt); void roadmap_screen_shutdown (void); Modified: trunk/roadmap/src/roadmap_sprite.c =================================================================== --- trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:37 UTC (rev 2821) +++ trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:40 UTC (rev 2822) @@ -368,7 +368,7 @@ for (i = 0; i < count; i++) { roadmap_screen_text_extents (ROADMAP_TEXT_LABELS, textseq->obj.strings[i], - sprite->textsize, &width, &ascent, &descent, NULL); + sprite->textsize, NULL, &width, &ascent, &descent, NULL); if (width > max_width) max_width = width; tot_height += ascent + descent + 2; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:39
|
Revision: 2821 http://sourceforge.net/p/roadmap/code/2821 Author: pgf Date: 2015-05-31 23:08:37 +0000 (Sun, 31 May 2015) Log Message: ----------- agg_support/roadmap_canvas: implement roadmap_canvas_set_label_font_size() Modified Paths: -------------- trunk/roadmap/src/agg_support/roadmap_canvas.cpp Modified: trunk/roadmap/src/agg_support/roadmap_canvas.cpp =================================================================== --- trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:08:34 UTC (rev 2820) +++ trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:08:37 UTC (rev 2821) @@ -55,7 +55,7 @@ #define MAX_STR_LEN 65000 #endif -#define DEFAULT_FONT_SIZE 15 +#define DEFAULT_FONT_SIZE 20 extern "C" { #include "roadmap.h" @@ -114,6 +114,7 @@ char *font_color_name; agg::rgba8 font_color; int thickness; + int size; }; static struct roadmap_canvas_pen *RoadMapPenList = NULL; @@ -153,6 +154,7 @@ (const char *text, int size, int *width, int *ascent, int *descent, int *can_tilt) { + size = CurrentPen->size; *ascent = 0; *descent = 0; if (can_tilt) *can_tilt = 1; @@ -240,6 +242,7 @@ pen->font_color = pen->color = agg::rgba8(0, 0, 0); pen->thickness = 1; + pen->size = DEFAULT_FONT_SIZE; pen->next = RoadMapPenList; RoadMapPenList = pen; @@ -267,6 +270,12 @@ roadmap_canvas_select_pen(CurrentPen); } +void roadmap_canvas_set_label_font_size(int size) { + if (!CurrentPen) return; + CurrentPen->size = size; + roadmap_canvas_select_pen(CurrentPen); +} + void roadmap_canvas_set_linestyle (const char *style) { // unimplemented @@ -307,7 +316,6 @@ void roadmap_canvas_set_brush_isbackground(int isbackground) {} void roadmap_canvas_set_label_font_name(const char *name) {} -void roadmap_canvas_set_label_font_size(int size) {} void roadmap_canvas_set_label_font_spacing(int spacing) {} void roadmap_canvas_set_label_font_weight(const char *weight) {} void roadmap_canvas_set_label_font_style(int style) {} @@ -665,7 +673,7 @@ double x = 0; double y = 0; - if (size < 0) size = DEFAULT_FONT_SIZE; + size = CurrentPen->size; if ((angle > -5) && (angle < 5)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:36
|
Revision: 2820 http://sourceforge.net/p/roadmap/code/2820 Author: pgf Date: 2015-05-31 23:08:34 +0000 (Sun, 31 May 2015) Log Message: ----------- default/All: make use of empty category shorthand being able to omit the layer name makes it much easier to maintain this file. Modified Paths: -------------- trunk/roadmap/src/default/All Modified: trunk/roadmap/src/default/All =================================================================== --- trunk/roadmap/src/default/All 2015-05-31 23:08:31 UTC (rev 2819) +++ trunk/roadmap/src/default/All 2015-05-31 23:08:34 UTC (rev 2820) @@ -8,127 +8,136 @@ Navigation.Foot: Streets Trails Shore Parks Stations Malls Hospitals Airports Navigation.Boat: Rivers Shore Lakes Sea Freeways.Color: black -Freeways.Color1: IndianRed -Freeways.Delta1: -2 -Freeways.Color2: black -Freeways.Delta2: 1 -Freeways.Declutter: 10000 -Freeways.Thickness: 6 -Freeways.Speed: 120 + .Color1: IndianRed + .Delta1: -2 + .Color2: black + .Delta2: 1 + .Declutter: 10000 + .Thickness: 6 + .Speed: 120 Ramps.Color: black -Ramps.Color1: red -Ramps.Delta1: -2 -Ramps.Declutter: 160 -Ramps.Thickness: 3 -Ramps.Speed: 120 + .Color1: red + .Delta1: -2 + .Declutter: 160 + .Thickness: 3 + .Speed: 120 Highways.Color: black -Highways.Color1: yellow -Highways.Delta1: -2 -Highways.Declutter: 1300 -Highways.Thickness: 3 -Highways.Speed: 120 + .Color1: yellow + .Delta1: -2 + .Declutter: 1300 + .Thickness: 3 + .Speed: 120 Streets.Color: black -Streets.Color1: white -Streets.Delta1: -2 -Streets.Declutter: 160 -Streets.Thickness: 2 -Streets.Speed: 90 + .Color1: white + .Delta1: -2 + .Declutter: 160 + .Thickness: 2 + .Speed: 90 Trails.Color: DarkGrey -Trails.Declutter: 160 -Trails.Thickness: 1 -Trails.Speed: 50 + .LabelFontColor: Black + .LabelFontSize: 10 + .Declutter: 160 + .Thickness: 1 + .Speed: 50 Railroads.Color: black -Railroads.Declutter: 250 -Railroads.Style: dashed -Railroads.Thickness: 1 -Railroads.Speeds: 1 + .Declutter: 250 + .Style: dashed + .Thickness: 1 + .Speeds: 1 + .LabelFontSize: 10 Rivers.Color: LightBlue -Rivers.LabelFontColor: DarkBlue -Rivers.Declutter: 300 -Rivers.Thickness: 3 -Rivers.Speed: 1 + .LabelFontColor: DarkBlue + .LabelFontSize: 10 + .Declutter: 300 + .Thickness: 3 + .Speed: 1 Shore.Color: LightSlateBlue -Shore.Declutter: 2000 -Shore.Thickness: 2 -Shore.Speed: 30 + .Declutter: 2000 + .Thickness: 2 + .Speed: 30 Hospitals.Color: red -Hospitals.Declutter: 300 -Hospitals.Thickness: 1 -Hospitals.Speed: 1 + .Declutter: 300 + .Thickness: 1 + .Speed: 1 Malls.Color: yellow -Malls.Declutter: 300 -Malls.Thickness: 1 -Malls.Speed: 1 + .Declutter: 300 + .Thickness: 1 + .Speed: 1 Schools.Color: beige -Schools.Declutter: 300 -Schools.Thickness: 1 -Schools.Speed: 1 + .Declutter: 300 + .Thickness: 1 + .Speed: 1 Airports.Color: grey -Airports.Declutter: 300 -Airports.Thickness: 1 -Airports.Speed: 1 + .Declutter: 300 + .Thickness: 1 + .Speed: 1 Stations.Color: grey -Stations.Declutter: 300 -Stations.Thickness: 1 -Stations.Speed: 1 + .Declutter: 300 + .Thickness: 1 + .Speed: 1 Lakes.Color: LightBlue -Lakes.Declutter: 1300 -Lakes.Thickness: 1 -Lakes.Speed: 1 + .Declutter: 1300 + .Thickness: 1 + .Speed: 1 Parks.Color: green -Parks.Declutter: 600 -Parks.Thickness: 1 -Parks.Speed: 30 + .Declutter: 600 + .Thickness: 1 + .Speed: 30 Sea.Color: SlateBlue -Sea.Declutter: 2147483647 -Sea.Thickness: 1 -Sea.Speed: 1 + .Declutter: 2147483647 + .Thickness: 1 + .Speed: 1 Boundaries.Color: darkgreen -Boundaries.Thickness: 2 -Boundaries.Declutter: 2147483647 -Boundaries.Speed: 1 + .Thickness: 2 + .Declutter: 2147483647 + .Speed: 1 Nature.Color: green -Nature.Declutter: 600 -Nature.Thickness: 1 -Nature.Speed: 1 + .Declutter: 600 + .Thickness: 1 + .Speed: 1 Amenity.Color: orange -Amenity.Declutter: 160 -Amenity.Thickness: 1 -Amenity.Speed: 1 + .Declutter: 160 + .Thickness: 1 + .Speed: 1 City.Color: red -City.Declutter: 10001 -City.LabelFontColor: Brown + .Declutter: 10001 + .LabelFontColor: Brown Town.Color: red -Town.Declutter: 10002 -Town.LabelFontColor: Brown + .Declutter: 10002 + .LabelFontColor: Brown Village.Color: red -Village.Declutter: 1300 -Village.LabelFontColor: Brown + .Declutter: 1300 + .LabelFontColor: Brown Hamlet.Color: red -Hamlet.Declutter: 10 -Hamlet.LabelFontColor: Brown + .Declutter: 10 + .LabelFontColor: Brown Suburbs.Color: grey -Suburbs.Declutter: 1300 -Suburbs.LabelFontColor: Brown + .Declutter: 1300 + .LabelFontColor: Brown Peak.Color: brown -Peak.Declutter: 1000 + .Declutter: 1000 Food.Sprite: Food -Food.Declutter: 1300 -Food.LabelDeclutter: 10 + .Declutter: 1300 + .LabelDeclutter: 10 + .LabelFontSize: 10 Cafe.Sprite: Cafe -Cafe.Declutter: 1300 -Cafe.LabelDeclutter: 10 + .Declutter: 1300 + .LabelDeclutter: 10 + .LabelFontSize: 10 Fuel.Sprite: Fuel -Fuel.Declutter: 1300 -Fuel.LabelDeclutter: 10 + .Declutter: 1300 + .LabelDeclutter: 10 + .LabelFontSize: 10 Drinks.Sprite: Drinks -Drinks.Declutter: 1300 -Drinks.LabelDeclutter: 10 + .Declutter: 1300 + .LabelDeclutter: 10 + .LabelFontSize: 10 ATM.Sprite: ATM -ATM.Declutter: 1300 -ATM.LabelDeclutter: 10 + .Declutter: 1300 + .LabelDeclutter: 10 + .LabelFontSize: 10 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:33
|
Revision: 2819 http://sourceforge.net/p/roadmap/code/2819 Author: pgf Date: 2015-05-31 23:08:31 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_config: allow empty category names an empty category name will use the previously named category. Modified Paths: -------------- trunk/roadmap/src/roadmap_config.c Modified: trunk/roadmap/src/roadmap_config.c =================================================================== --- trunk/roadmap/src/roadmap_config.c 2015-05-31 23:08:28 UTC (rev 2818) +++ trunk/roadmap/src/roadmap_config.c 2015-05-31 23:08:31 UTC (rev 2819) @@ -539,7 +539,7 @@ FILE *file; char line[1024]; - char *category; + char *category, *prevcategory = NULL; char *name; char *value; @@ -561,12 +561,14 @@ if (fgets (line, sizeof(line), file) == NULL) break; - category = roadmap_config_extract_data (line, sizeof(line)); - if (category == NULL) continue; + p = roadmap_config_extract_data (line, sizeof(line)); + if (p == NULL) continue; /* Decode the line (category.name: value). */ - p = roadmap_config_skip_until (category, '.'); + category = p; + + p = roadmap_config_skip_until (p, '.'); if (*p != '.') continue; *(p++) = 0; @@ -587,7 +589,18 @@ value = strdup (value); descriptor.name = strdup (name); - descriptor.category = strdup (category); + if (!*category) { + if (prevcategory) { + descriptor.category = strdup(prevcategory); + } else { + roadmap_log (ROADMAP_FATAL, "Empty category name used" + "without prior category in %s", config->file_name); + } + } else { + descriptor.category = strdup (category); + free(prevcategory); + prevcategory = strdup(category); + } descriptor.reference = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:30
|
Revision: 2818 http://sourceforge.net/p/roadmap/code/2818 Author: pgf Date: 2015-05-31 23:08:28 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_place: work in progress -- find nearest place Modified Paths: -------------- trunk/roadmap/src/roadmap_place.c trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_place.c =================================================================== --- trunk/roadmap/src/roadmap_place.c 2015-05-31 23:08:25 UTC (rev 2817) +++ trunk/roadmap/src/roadmap_place.c 2015-05-31 23:08:28 UTC (rev 2818) @@ -253,4 +253,67 @@ return roadmap_dictionary_get(RoadMapPlaceActive->PlaceNames, stringid); } +#if NEAREST_PLACE +static int roadmap_place_get_distance (const RoadMapPosition *position, + int line, int layer, RoadMapNeighbour *neighbour) + if (roadmap_math_line_is_visible (&neighbour->from, &neighbour->to)) { + calculate distance + } +} +static int roadmap_place_get_closest_in_square + (const RoadMapPosition *position, int square, int layer, + RoadMapNeighbour *neighbours, int count, int max) { + if (roadmap_place_in_square (square, layer, &first, &last) > 0) { + for (line = first_line; line <= last_line; line++) { + if (roadmap_place_get_distance (position, line, layer, &this)) { + count = roadmap_street_replace (neighbours, count, max, &this); + } + } + } +} +int roadmap_place_closest (const RoadMapArea *focus, + const RoadMapPosition *position, + PluginLine *place, + int *distance) { + + static int *fipslist = NULL; + + int i; + int county; + int county_count; + int square; + + int count = 0; + + + if (RoadMapRangeActive == NULL) return 0; + + roadmap_math_set_focus (focus); + + county_count = roadmap_locator_by_position (position, &fipslist); + + /* - For each candidate county: */ + + for (county = county_count - 1; county >= 0; --county) { + + /* -- Access the county's database. */ + if (roadmap_locator_activate (fipslist[county]) != ROADMAP_US_OK) continue; + + /* -- Look for the square the current location fits in. */ + square = roadmap_square_search (position); + + if (square >= 0) { + /* The current location fits in one of the county's squares. */ + for (i = 0; i < categories_count; ++i) { + count = roadmap_place_get_closest_in_square + (position, square, categories[i], neighbours, count, max); + } + } + } + + roadmap_math_release_focus (); + + return count; +} +#endif Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:25 UTC (rev 2817) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:28 UTC (rev 2818) @@ -1826,6 +1826,10 @@ if (roadmap_trip_retrieve_area_points(&area, &position)) { ; +#if NEAREST_PLACE + } else if (roadmap_place_closest( + (&area, &position, &place, &distance) != -1) { +#endif } else if (roadmap_navigate_retrieve_line (&area, &position, &line, &distance) != -1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:27
|
Revision: 2817 http://sourceforge.net/p/roadmap/code/2817 Author: pgf Date: 2015-05-31 23:08:25 +0000 (Sun, 31 May 2015) Log Message: ----------- support for POI sprites for food/cafe/drinks/fuel/ATM added decluttering for the labels and for the sprites themselves. Modified Paths: -------------- trunk/roadmap/src/default/All trunk/roadmap/src/roadmap_layer.c trunk/roadmap/src/roadmap_layer.h trunk/roadmap/src/roadmap_math.c trunk/roadmap/src/roadmap_screen.c trunk/roadmap/src/roadmap_sprite.c trunk/roadmap/src/sprites Modified: trunk/roadmap/src/default/All =================================================================== --- trunk/roadmap/src/default/All 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/default/All 2015-05-31 23:08:25 UTC (rev 2817) @@ -113,18 +113,22 @@ Peak.Color: brown Peak.Declutter: 1000 -Food.Color: pink +Food.Sprite: Food Food.Declutter: 1300 -Food.LabelFontColor: pink -Cafe.Color: aqua +Food.LabelDeclutter: 10 + +Cafe.Sprite: Cafe Cafe.Declutter: 1300 -Cafe.LabelFontColor: aqua -Fuel.Color: grey +Cafe.LabelDeclutter: 10 + +Fuel.Sprite: Fuel Fuel.Declutter: 1300 -Fuel.LabelFontColor: grey -Drinks.Color: blue +Fuel.LabelDeclutter: 10 + +Drinks.Sprite: Drinks Drinks.Declutter: 1300 -Drinks.LabelFontColor: blue -ATM.Color: green +Drinks.LabelDeclutter: 10 + +ATM.Sprite: ATM ATM.Declutter: 1300 -ATM.LabelFontColor: green +ATM.LabelDeclutter: 10 Modified: trunk/roadmap/src/roadmap_layer.c =================================================================== --- trunk/roadmap/src/roadmap_layer.c 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/roadmap_layer.c 2015-05-31 23:08:25 UTC (rev 2817) @@ -55,6 +55,7 @@ #include "roadmap_canvas.h" #include "roadmap_input.h" #include "roadmap_plugin.h" +#include "roadmap_sprite.h" #include "roadmap_layer.h" @@ -154,6 +155,7 @@ RoadMapConfigDescriptor declutter; RoadMapConfigDescriptor thickness; + RoadMapConfigDescriptor label_declutter; unsigned int pen_count; RoadMapPen pen[ROADMAP_MAX_LAYER_PENS]; @@ -161,6 +163,7 @@ int navigation_modes; /**< bitwise OR of the navigation modes supported */ RoadMapConfigDescriptor speed; /**< max speed */ + RoadMapConfigDescriptor sprite; } RoadMapLayer; @@ -253,7 +256,6 @@ return r; } - unsigned int roadmap_layer_max_defined(void) { return RoadMapMaxDefinedLayers + 1; /* To be safe, allocate a bit more. */ @@ -344,9 +346,6 @@ layerp = RoadMapLayerCurrentClass->layers + i; - if (pen_index >= layerp->pen_count) continue; - if (! layerp->in_use[pen_index]) continue; - if (roadmap_layer_is_visible (layerp)) { if (count >= size) goto done; layers[count++] = i + 1; @@ -886,6 +885,14 @@ layer->declutter.name = "Declutter"; roadmap_config_declare (class_config, &layer->declutter, "20248000000"); + layer->label_declutter.category = layernames[i]; + layer->label_declutter.name = "LabelDeclutter"; + roadmap_config_declare (class_config, &layer->label_declutter, "1000"); + + layer->sprite.category = layernames[i]; + layer->sprite.name = "Sprite"; + roadmap_config_declare (class_config, &layer->sprite, "Amenity"); + layer->speed.category = layernames[i]; layer->speed.name = "Speed"; roadmap_config_declare (class_config, &layer->speed, "120"); @@ -1120,25 +1127,67 @@ } /** + * @brief returns the value of the text declutter parameter of this + * layer, from default/All. + * @param layer + * @return -- whether or not labels should be printed at this zoom + */ +int roadmap_layer_labels_visible(int layer) +{ + RoadMapLayer *layerp; + int d; + + layer--; + + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_labels_visible : no current class"); + return 0; + } + + layerp = RoadMapLayerCurrentClass->layers + layer; + d = roadmap_config_get_integer (&layerp->label_declutter); + roadmap_log (ROADMAP_DEBUG, "roadmap_layer_road_last: declutter %d", d); + return roadmap_math_declutter (d); +} + + +/** * @brief returns the value of the Speed parameter of this layer, from default/All. * @param layer * @return speed, assumed by calling code to be in km/h (FIX ME) */ int roadmap_layer_speed(int layer) { - RoadMapLayer *layerp; + RoadMapLayer *layerp; - layer--; + layer--; - if (RoadMapLayerCurrentClass == NULL) { - roadmap_log (ROADMAP_FATAL, "roadmap_layer_road_last : no current class"); - return 0; - } + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_speed: no current class"); + return 0; + } - layerp = RoadMapLayerCurrentClass->layers + layer; - return roadmap_config_get_integer (&layerp->speed); + layerp = RoadMapLayerCurrentClass->layers + layer; + return roadmap_config_get_integer (&layerp->speed); } +/** + * @brief returns the Sprite for the layer, used for places/POIs + * @param layer + * @return pointer to sprite, if any. + */ +const char *roadmap_layer_sprite (int layer) { + + RoadMapLayer *layerp; + + layer--; + + if (RoadMapLayerCurrentClass == NULL) return NULL; + + layerp = RoadMapLayerCurrentClass->layers + layer; + return roadmap_config_get (&layerp->sprite); +} + void roadmap_layer_shutdown (void) { RoadMapNavigationModeCount = 0; Modified: trunk/roadmap/src/roadmap_layer.h =================================================================== --- trunk/roadmap/src/roadmap_layer.h 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/roadmap_layer.h 2015-05-31 23:08:25 UTC (rev 2817) @@ -114,6 +114,8 @@ int roadmap_layer_road_last(void); int roadmap_layer_speed(int layer); +const char *roadmap_layer_sprite (int layer); +int roadmap_layer_labels_visible(int layer); #endif // INCLUDED__ROADMAP_LAYER__H Modified: trunk/roadmap/src/roadmap_math.c =================================================================== --- trunk/roadmap/src/roadmap_math.c 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/roadmap_math.c 2015-05-31 23:08:25 UTC (rev 2817) @@ -1152,9 +1152,10 @@ } -int roadmap_math_declutter (int level) { +/* returns true if the current zoom is _less_ than the declutter level */ +int roadmap_math_declutter (int declutter_level) { - return (RoadMapContext->zoom < level); + return (RoadMapContext->zoom < declutter_level); } Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:25 UTC (rev 2817) @@ -1275,7 +1275,9 @@ int place; int first_place; int last_place; - RoadMapPen layer_pen; + RoadMapPen layer_pen = 0; + const char *layer_sprite; + int labels_visible; int fips; int drawn = 0; @@ -1283,6 +1285,8 @@ layer_pen = roadmap_layer_get_pen (layer, pen_index); if (layer_pen == NULL) return 0; + layer_sprite = roadmap_layer_sprite(layer); + labels_visible = roadmap_layer_labels_visible(layer); fips = roadmap_locator_active (); @@ -1295,12 +1299,13 @@ roadmap_place_point(place, &pos); roadmap_math_coordinate (&pos, &guipoint); -#if PLACE_MARK - roadmap_sprite_draw ("PurpleCross" , &guipoint, 0); - roadmap_math_rotate_coordinates (1, &guipoint); -#endif + if (layer_sprite) { + roadmap_sprite_draw (layer_sprite, &guipoint, 0); + roadmap_math_rotate_coordinates (1, &guipoint); + } - if ((pen_index == 0) && /* we do labels only for the first pen */ + if (labels_visible && + pen_index == 0 && /* we do labels only for the first pen */ !RoadMapScreenDragging && RoadMapScreenLabels) { PluginPlace p = {ROADMAP_PLUGIN_ID, place, layer, fips}; @@ -1671,6 +1676,7 @@ } + /* -- places -- */ for (i = count-1; i >= 0; --i) { /* -- nothing to draw at this zoom? -- */ @@ -1684,30 +1690,29 @@ /* -- Look for the squares that are currently visible. */ sqcount = roadmap_square_view (&in_view); - for (pen = 0; pen < max_pen; ++pen) { + pen = 0; - if (sqcount > 0) { - static int *layers = NULL; - static int layers_size = 0; - int layer_count; + if (sqcount > 0) { + static int *layers = NULL; + static int layers_size = 0; + int layer_count; - roadmap_screen_reset_square_mask(); + 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_places - (layers, layers_size, pen); - if (!layer_count) continue; + 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_places + (layers, layers_size, pen); + if (!layer_count) continue; - for (sq = sqcount - 1; sq >= 0; --sq) { - drawnlist[i] += roadmap_screen_repaint_square (in_view[sq], - pen, layer_count, layers, PLACES); - } + for (sq = sqcount - 1; sq >= 0; --sq) { + drawnlist[i] += roadmap_screen_repaint_square (in_view[sq], + pen, layer_count, layers, PLACES); + } - } } if (roadmap_screen_repaint_leave(count, count - i)) { @@ -1718,6 +1723,7 @@ } + /* -- labels -- */ for (i = count-1; i >= 0; --i) { /* -- nothing to draw at this zoom? -- */ Modified: trunk/roadmap/src/roadmap_sprite.c =================================================================== --- trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:25 UTC (rev 2817) @@ -133,8 +133,13 @@ */ static RoadMapSprite roadmap_sprite_search (const char *name) { - RoadMapSprite cursor; + static RoadMapSprite cursor; + /* optimize for repeated lookups */ + if (cursor && strcasecmp(name, cursor->name) == 0) { + return cursor; + } + for (cursor = RoadMapSpriteList; cursor != NULL; cursor = cursor->next) { if (strcasecmp(name, cursor->name) == 0) { Modified: trunk/roadmap/src/sprites =================================================================== --- trunk/roadmap/src/sprites 2015-05-31 23:08:22 UTC (rev 2816) +++ trunk/roadmap/src/sprites 2015-05-31 23:08:25 UTC (rev 2817) @@ -109,6 +109,24 @@ S ZoomOut A CircleMinus +S Amenity +A DottedCircle + +S Food +A Plate + +S Cafe +A Cup + +S Drinks +A Mug + +S Fuel +A FuelPump + +S ATM +A Money + # The actual drawing sprites: S BlueDart @@ -236,6 +254,11 @@ F black 1 C 0,0 7 +S DottedCircle +F black 1 +C 0,0 7 +C 0,0 1 + S Circle-Pointer F green 1 D 0,0 7 @@ -501,3 +524,50 @@ F darkgreen 2 T 0,0 20 +S Mug +F black 2 +C 0,0 3 +F gold 1 +P 0,-3 0,6 6,6 6,-3 +F black 2 +L 0,-4 0,6 6,6 6,-4 +F white 2 +L 1,-4 5,-4 + +S Cup +F black 2 +C -4,2 3 +F white 1 +P -5,-2 -3,7 3,7 5,-2 +F black 2 +L -5,-2 -3,7 3,7 5,-2 -5,-2 +L -6,7 6,7 + +S Money +F lightgreen 1 +P -7,-4 7,-4 7,4 -7,4 -7,-4 +F black 1 +L -7,-4 7,-4 7,4 -7,4 -7,-4 +D 0,0 1 +D 0,1 2 +C 0,0 3 +D -5,-2 1 +D 5,2 1 + +S Plate +F white 1 +D 0,0 4 +F green 2 +C 1,4 6 +L -8,2 -8,9 +L -9,-2 -9,1 -8,2 -7,1 -7,-2 +L 10,-2 10,9 + +S FuelPump +F red 1 +P -4,-3 -4,12 4,12 4,-3 +F black 1 +L 4,10 5,10 5,0 6,-1 +F white 1 +P -2,-1 -2,4 2,4 2,-1 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:24
|
Revision: 2816 http://sourceforge.net/p/roadmap/code/2816 Author: pgf Date: 2015-05-31 23:08:22 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_label: code cleanup Modified Paths: -------------- trunk/roadmap/src/roadmap_label.c Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:19 UTC (rev 2815) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:22 UTC (rev 2816) @@ -407,7 +407,6 @@ (whichlist == OLDLIST ? &RoadMapLabelCache : &RoadMapLabelNew, item, tmp) { - cPtr = (roadmap_label *)item; if ((unsigned short)(RoadMapLabelGeneration - cPtr->gen) > @@ -495,12 +494,6 @@ #if LABEL_USING_LINEID { char buf[1000]; -#if 0 - if (cPtr->place.place_id == 105 || - cPtr->place.place_id == 65) { - roadmap_log(ROADMAP_DEBUG, "arl or lex"); - } -#endif sprintf(buf, "P%d %s", cPtr->place.place_id, cPtr->text); cPtr->otext = cPtr->text; cPtr->text = strdup(buf); @@ -520,8 +513,7 @@ #if LABEL_USING_LINEID { char buf[1000]; - sprintf(buf, "%d", cPtr->line.line_id); - sprintf(buf, "L%d %s", cPtr->line.line_id, cPtr->text); + sprintf(buf, "L%d %s", cPtr->line.line_id, cPtr->text); cPtr->otext = cPtr->text; cPtr->text = strdup(buf); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:21
|
Revision: 2815 http://sourceforge.net/p/roadmap/code/2815 Author: pgf Date: 2015-05-31 23:08:19 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_screen: code cleanup Modified Paths: -------------- trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:16 UTC (rev 2814) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:08:19 UTC (rev 2815) @@ -183,6 +183,8 @@ static struct roadmap_screen_point_buffer LinePoints; static struct roadmap_screen_point_buffer Points; +#define PLACES 0 +#define LINES 1 static RoadMapPen RoadMapBackground = NULL; static RoadMapPen RoadMapPenEdges = NULL; @@ -1296,7 +1298,6 @@ #if PLACE_MARK roadmap_sprite_draw ("PurpleCross" , &guipoint, 0); roadmap_math_rotate_coordinates (1, &guipoint); - roadmap_canvas_set_foreground("black"); #endif if ((pen_index == 0) && /* we do labels only for the first pen */ @@ -1429,7 +1430,7 @@ static int roadmap_screen_repaint_square (int square, int pen_type, - int layer_count, int *layers, int lines) { + int layer_count, int *layers, int which) { int i; @@ -1474,7 +1475,7 @@ category = layers[i]; - if (lines) { + if (which == LINES) { drawn += roadmap_screen_draw_square_lines (square, category, fully_visible, pen_type); } else { // places @@ -1484,7 +1485,7 @@ } - if (lines) { + if (which == LINES) { roadmap_screen_flush_lines(); roadmap_screen_flush_points(); } @@ -1649,7 +1650,7 @@ for (sq = sqcount - 1; sq >= 0; --sq) { drawnlist[i] += roadmap_screen_repaint_square (in_view[sq], - pen, layer_count, layers, 1); + pen, layer_count, layers, LINES); } } @@ -1703,7 +1704,7 @@ for (sq = sqcount - 1; sq >= 0; --sq) { drawnlist[i] += roadmap_screen_repaint_square (in_view[sq], - pen, layer_count, layers, 0); + pen, layer_count, layers, PLACES); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:18
|
Revision: 2814 http://sourceforge.net/p/roadmap/code/2814 Author: pgf Date: 2015-05-31 23:08:16 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_sprite.c: restore previous pen when finished drawing this lets us put sprites up just about any time, without disturbing other drawing operations too much. useful for debugging. Modified Paths: -------------- trunk/roadmap/src/roadmap_sprite.c Modified: trunk/roadmap/src/roadmap_sprite.c =================================================================== --- trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:13 UTC (rev 2813) +++ trunk/roadmap/src/roadmap_sprite.c 2015-05-31 23:08:16 UTC (rev 2814) @@ -815,6 +815,7 @@ RoadmapSpriteDrawingSequence *textseq; RoadmapSpriteDrawingSequence textsequence[1]; int scale; + RoadMapPen oldpen, prevpen = NULL; if (sprite == NULL || sprite->alias_name != NULL) { roadmap_log (ROADMAP_WARNING, "roadmap_sprite_draw_with_text(%s): NULL", name); @@ -843,7 +844,8 @@ plane != NULL; plane = plane->next) { - roadmap_canvas_select_pen (plane->pen); + oldpen = roadmap_canvas_select_pen (plane->pen); + if (!prevpen) prevpen = oldpen; if (plane->polygons.object_count > 0) { @@ -941,6 +943,8 @@ } if (text_bbox && text_bbox != &sprite->text_bbox) roadmap_sprite_scale_bbox(text_bbox, text_bbox, scale); + + roadmap_canvas_select_pen (prevpen); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:15
|
Revision: 2813 http://sourceforge.net/p/roadmap/code/2813 Author: pgf Date: 2015-05-31 23:08:13 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_start: report zoom level in "Map Parameters" useful when tweaking declutter values in the config files Modified Paths: -------------- trunk/roadmap/src/roadmap_math.c trunk/roadmap/src/roadmap_math.h trunk/roadmap/src/roadmap_start.c Modified: trunk/roadmap/src/roadmap_math.c =================================================================== --- trunk/roadmap/src/roadmap_math.c 2015-05-31 23:08:09 UTC (rev 2812) +++ trunk/roadmap/src/roadmap_math.c 2015-05-31 23:08:13 UTC (rev 2813) @@ -1114,17 +1114,24 @@ return 0; } -void roadmap_math_zoom_set (int zoom) { +int roadmap_math_zoom_set (int zoom) { - if (zoom < MIN_ZOOM_IN) { + int oldzoom; + + if (!zoom) { + return RoadMapContext->zoom; + } else if (zoom < MIN_ZOOM_IN) { zoom = MIN_ZOOM_IN; } else if (zoom >= MAX_ZOOM_OUT) { zoom = MAX_ZOOM_OUT - 1; } + oldzoom = zoom; RoadMapContext->zoom = zoom; roadmap_config_set_integer (&RoadMapConfigGeneralZoom, RoadMapContext->zoom); roadmap_math_compute_scale (); + + return oldzoom; } int roadmap_math_zoom_reset (void) { Modified: trunk/roadmap/src/roadmap_math.h =================================================================== --- trunk/roadmap/src/roadmap_math.h 2015-05-31 23:08:09 UTC (rev 2812) +++ trunk/roadmap/src/roadmap_math.h 2015-05-31 23:08:13 UTC (rev 2813) @@ -49,7 +49,7 @@ int roadmap_math_zoom_out (void); int roadmap_math_zoom_reset (void); void roadmap_math_compute_scale (void); -void roadmap_math_zoom_set (int zoom); +int roadmap_math_zoom_set (int zoom); void roadmap_math_set_center (const RoadMapPosition *position); RoadMapPosition *roadmap_math_get_center (void); Modified: trunk/roadmap/src/roadmap_start.c =================================================================== --- trunk/roadmap/src/roadmap_start.c 2015-05-31 23:08:09 UTC (rev 2812) +++ trunk/roadmap/src/roadmap_start.c 2015-05-31 23:08:13 UTC (rev 2813) @@ -324,10 +324,12 @@ snprintf(map_info, sizeof(map_info), "Map view area: %s wide by %s high\n" - "Map center (lat,lon): %s, %s", + "Map center (lat,lon): %s, %s\n" + "Current zoom level is %d", roadmap_message_get('x'), roadmap_message_get('y'), - clat, clon); + clat, clon, + roadmap_math_zoom_set (0)); roadmap_messagebox_wait ("Map Parameters", map_info); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:12
|
Revision: 2812 http://sourceforge.net/p/roadmap/code/2812 Author: pgf Date: 2015-05-31 23:08:09 +0000 (Sun, 31 May 2015) Log Message: ----------- rdm_osm_fetch_tile: don't fetch if we have either .osm or .osm.gz Modified Paths: -------------- trunk/roadmap/src/rdm_osm_fetch_tile Modified: trunk/roadmap/src/rdm_osm_fetch_tile =================================================================== --- trunk/roadmap/src/rdm_osm_fetch_tile 2015-05-31 23:08:06 UTC (rev 2811) +++ trunk/roadmap/src/rdm_osm_fetch_tile 2015-05-31 23:08:09 UTC (rev 2812) @@ -49,6 +49,11 @@ echo Already have $xmlfile exit fi +if [ -e ${xmlfile%.gz} ] +then + echo Already have uncompressed $xmlfile + exit +fi # normally the .osm.gz files are stored alongside the .rdm files. # but for development, it can be convenient to be able to get the .osm from This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:09
|
Revision: 2811 http://sourceforge.net/p/roadmap/code/2811 Author: pgf Date: 2015-05-31 23:08:06 +0000 (Sun, 31 May 2015) Log Message: ----------- add a few important POI layers: food, fuel, ATM Modified Paths: -------------- trunk/roadmap/src/buildmap_osm_common.c trunk/roadmap/src/buildmap_osm_common.h trunk/roadmap/src/buildmap_osm_text.c trunk/roadmap/src/default/All Modified: trunk/roadmap/src/buildmap_osm_common.c =================================================================== --- trunk/roadmap/src/buildmap_osm_common.c 2015-05-31 23:08:03 UTC (rev 2810) +++ trunk/roadmap/src/buildmap_osm_common.c 2015-05-31 23:08:06 UTC (rev 2811) @@ -67,39 +67,50 @@ /* Road layers. */ -int BuildMapLayerFreeway = 0; -int BuildMapLayerRamp = 0; -int BuildMapLayerMain = 0; -int BuildMapLayerStreet = 0; -int BuildMapLayerTrail = 0; -int BuildMapLayerRail = 0; +int BuildMapLayerFreeway; +int BuildMapLayerRamp; +int BuildMapLayerMain; +int BuildMapLayerStreet; +int BuildMapLayerTrail; +int BuildMapLayerRail; /* Area layers. */ -int BuildMapLayerPark = 0; -int BuildMapLayerHospital = 0; -int BuildMapLayerAirport = 0; -int BuildMapLayerStation = 0; -int BuildMapLayerMall = 0; -int BuildMapLayerNature = 0; -int BuildMapLayerAmenity = 0; -int BuildMapLayerCity = 0; -int BuildMapLayerTown = 0; -int BuildMapLayerVillage = 0; -int BuildMapLayerHamlet = 0; -int BuildMapLayerSuburbs = 0; -int BuildMapLayerPeak = 0; +int BuildMapLayerPark; +int BuildMapLayerHospital; +int BuildMapLayerAirport; +int BuildMapLayerStation; +int BuildMapLayerMall; +int BuildMapLayerSchool; +int BuildMapLayerNature; +int BuildMapLayerAmenity; +int BuildMapLayerCity; +int BuildMapLayerTown; +int BuildMapLayerVillage; +int BuildMapLayerHamlet; +int BuildMapLayerSuburbs; +int BuildMapLayerPeak; + /* Water layers. */ -int BuildMapLayerShoreline = 0; -int BuildMapLayerRiver = 0; -int BuildMapLayerCanal = 0; -int BuildMapLayerLake = 0; -int BuildMapLayerSea = 0; +int BuildMapLayerShoreline; +int BuildMapLayerRiver; +int BuildMapLayerCanal; +int BuildMapLayerLake; +int BuildMapLayerSea; -int BuildMapLayerBoundary = 0; +int BuildMapLayerBoundary; +int BuildMapLayerFood; +int BuildMapLayerCafe; +int BuildMapLayerDrinks; +int BuildMapLayerFuel; +int BuildMapLayerATM; + +/* These defines are simply shorthand notation, to make + * the tables below easier to manage + */ #define FREEWAY &BuildMapLayerFreeway #define RAMP &BuildMapLayerRamp #define MAIN &BuildMapLayerMain @@ -112,22 +123,31 @@ #define AIRPORT &BuildMapLayerAirport #define STATION &BuildMapLayerStation #define MALL &BuildMapLayerMall +#define SCHOOL &BuildMapLayerSchool #define SHORELINE &BuildMapLayerShoreline #define RIVER &BuildMapLayerRiver #define CANAL &BuildMapLayerCanal #define LAKE &BuildMapLayerLake #define SEA &BuildMapLayerSea -#define BOUNDARY &BuildMapLayerBoundary + #define NATURE &BuildMapLayerNature +#define PEAK &BuildMapLayerPeak #define AMENITY &BuildMapLayerAmenity +#define BOUNDARY &BuildMapLayerBoundary + #define CITY &BuildMapLayerCity #define TOWN &BuildMapLayerTown #define VILLAGE &BuildMapLayerVillage #define HAMLET &BuildMapLayerHamlet #define SUBURBS &BuildMapLayerSuburbs -#define PEAK &BuildMapLayerPeak +#define FOOD &BuildMapLayerFood +#define CAFE &BuildMapLayerCafe +#define DRINKS &BuildMapLayerDrinks +#define FUEL &BuildMapLayerFuel +#define ATM &BuildMapLayerATM + BuildMapDictionary DictionaryPrefix; BuildMapDictionary DictionaryStreet; BuildMapDictionary DictionaryType; @@ -151,6 +171,7 @@ BuildMapLayerAirport = buildmap_layer_get ("airports"); BuildMapLayerStation = buildmap_layer_get ("stations"); BuildMapLayerMall = buildmap_layer_get ("malls"); + BuildMapLayerSchool = buildmap_layer_get ("schools"); BuildMapLayerShoreline = buildmap_layer_get ("shore"); BuildMapLayerRiver = buildmap_layer_get ("rivers"); @@ -159,15 +180,21 @@ BuildMapLayerSea = buildmap_layer_get ("sea"); BuildMapLayerNature = buildmap_layer_get ("nature"); + BuildMapLayerPeak = buildmap_layer_get ("peak"); BuildMapLayerAmenity = buildmap_layer_get ("amenity"); + BuildMapLayerBoundary = buildmap_layer_get ("boundaries"); + BuildMapLayerCity = buildmap_layer_get ("city"); BuildMapLayerTown = buildmap_layer_get ("town"); BuildMapLayerVillage = buildmap_layer_get ("village"); BuildMapLayerHamlet = buildmap_layer_get ("hamlet"); BuildMapLayerSuburbs = buildmap_layer_get ("suburbs"); - BuildMapLayerPeak = buildmap_layer_get ("peak"); - BuildMapLayerBoundary = buildmap_layer_get ("boundaries"); + BuildMapLayerFuel = buildmap_layer_get ("fuel"); + BuildMapLayerFood = buildmap_layer_get ("food"); + BuildMapLayerCafe = buildmap_layer_get ("cafe"); + BuildMapLayerDrinks = buildmap_layer_get ("drinks"); + BuildMapLayerATM = buildmap_layer_get ("atm"); } char *stringtype[] = { @@ -358,36 +385,36 @@ layer_info_t amenity_to_layer[] = { { 0, NULL, 0 }, { "hospital", HOSPITAL, 0 }, /* 1 */ - { "pub", NULL, 0 }, /* 2 */ + { "pub", DRINKS, PLACE }, /* 2 */ { "parking", AMENITY, AREA }, /* 3 */ { "post_office", AMENITY, 0 }, /* 4 */ - { "fuel", NULL, 0 }, /* 5 */ + { "fuel", FUEL, PLACE }, /* 5 */ { "telephone", NULL, 0 }, /* 6 */ { "toilets", NULL, 0 }, /* 7 */ { "post_box", NULL, 0 }, /* 8 */ - { "school", AMENITY, AREA }, /* 9 */ + { "school", SCHOOL, AREA }, /* 9 */ { "supermarket", AMENITY, 0 }, /* 10 */ { "library", AMENITY, 0 }, /* 11 */ { "theatre", NULL, 0 }, /* 12 */ { "cinema", NULL, 0 }, /* 13 */ { "police", AMENITY, 0 }, /* 14 */ { "fire_station", AMENITY, 0 }, /* 15 */ - { "restaurant", NULL, 0 }, /* 16 */ - { "fast_food", NULL, 0 }, /* 17 */ /* Changed */ + { "restaurant", FOOD, PLACE }, /* 16 */ + { "fast_food", FOOD, PLACE }, /* 17 */ /* Changed */ { "bus_station", NULL, 0 }, /* 18 */ { "place_of_worship", AMENITY, 0 }, /* 19 */ - { "cafe", NULL, 0 }, /* 20 */ + { "cafe", CAFE, PLACE }, /* 20 */ { "bicycle_parking", AMENITY, AREA }, /* 21 */ { "public_building", AMENITY, AREA }, /* 22 */ { "grave_yard", PARK, AREA }, /* 23 */ - { "university", AMENITY, AREA }, /* 24 */ - { "college", AMENITY, AREA }, /* 25 */ + { "university", SCHOOL, AREA }, /* 24 */ + { "college", SCHOOL, AREA }, /* 25 */ { "townhall", AMENITY, AREA }, /* 26 */ - { "food_court", NULL, 0 }, /* 27 */ + { "food_court", FOOD, PLACE }, /* 27 */ { "drinking_water", NULL, 0 }, /* 28 */ - { "bbq", NULL, 0 }, /* 28 */ - { "bar", NULL, 0 }, /* 29 */ - { "biergarten", NULL, 0 }, /* 30 */ + { "bbq", FOOD, PLACE }, /* 28 */ + { "bar", DRINKS, PLACE }, /* 29 */ + { "biergarten", DRINKS, PLACE }, /* 30 */ { "ice_cream", NULL, 0 }, /* 31 */ { "kindergarten", NULL, 0 }, /* 32 */ { "ice_cream", NULL, 0 }, /* 33 */ @@ -398,7 +425,7 @@ { "car_wash", NULL, 0 }, /* 38 */ { "grit_bin", NULL, 0 }, /* 39 */ { "taxi", AMENITY, AREA }, /* 40 */ - { "atm", NULL, 0 }, /* 41 */ + { "atm", ATM, PLACE }, /* 41 */ { "bank", NULL, 0 }, /* 42 */ { "bureau_de_change", NULL, 0 }, /* 43 */ { "pharmacy", NULL, 0 }, /* 44 */ Modified: trunk/roadmap/src/buildmap_osm_common.h =================================================================== --- trunk/roadmap/src/buildmap_osm_common.h 2015-05-31 23:08:03 UTC (rev 2810) +++ trunk/roadmap/src/buildmap_osm_common.h 2015-05-31 23:08:06 UTC (rev 2811) @@ -90,6 +90,7 @@ extern int BuildMapLayerAirport; extern int BuildMapLayerStation; extern int BuildMapLayerMall; +extern int BuildMapLayerSchool; /* Water layers. */ @@ -99,8 +100,15 @@ extern int BuildMapLayerLake; extern int BuildMapLayerSea; +extern int BuildMapLayerFood; +extern int BuildMapLayerCafe; +extern int BuildMapLayerDrinks; +extern int BuildMapLayerFuel; +extern int BuildMapLayerATM; + extern int BuildMapLayerBoundary; +#if 0 #define FREEWAY &BuildMapLayerFreeway #define RAMP &BuildMapLayerRamp #define MAIN &BuildMapLayerMain @@ -120,6 +128,7 @@ #define LAKE &BuildMapLayerLake #define SEA &BuildMapLayerSea #define BOUNDARY &BuildMapLayerBoundary +#endif extern BuildMapDictionary DictionaryPrefix; extern BuildMapDictionary DictionaryStreet; Modified: trunk/roadmap/src/buildmap_osm_text.c =================================================================== --- trunk/roadmap/src/buildmap_osm_text.c 2015-05-31 23:08:03 UTC (rev 2810) +++ trunk/roadmap/src/buildmap_osm_text.c 2015-05-31 23:08:06 UTC (rev 2811) @@ -278,35 +278,6 @@ buildmap_osm_text_node_finish(void) { -#ifdef BEFORE - int point, s; - if (ni.NodeFakeFips) { - if (ni.NodePlace && (strcmp(ni.NodePlace, "town") == 0 - || strcmp(ni.NodePlace, "village") == 0 - || strcmp(ni.NodePlace, "hamlet") == 0 - || strcmp(ni.NodePlace, "city") == 0)) { - /* We have a town, process it */ - - if (ni.NodeName) { - ni.NodeFakeFips++; - int year = 2008; - RoadMapString s; - - s = buildmap_dictionary_add (DictionaryCity, - (char *) ni.NodeName, strlen(ni.NodeName)); - buildmap_city_add(ni.NodeFakeFips, year, s); - } - if (ni.NodePostalCode) { - int zip = 0; - s = sscanf(ni.NodePostalCode, "%d", &zip); - if (s != 1) - buildmap_fatal(0, "bad zip read at '%s'\n", ni.NodePostalCode); - if (zip) - buildmap_zip_add(zip, ni.NodeLon, ni.NodeLat); - } - } - } -#else int point; RoadMapString s; @@ -316,10 +287,9 @@ if (ni.NodeName && ni.NodePlace) { if (ni.NodeLayer) { - buildmap_verbose("finishing %f %f %s %s", + buildmap_verbose("finishing %f %f %s %s layer: %d", (float)ni.NodeLat/1000000.0, (float)ni.NodeLon/1000000.0, - ni.NodePlace, ni.NodeName); - + ni.NodePlace, ni.NodeName, ni.NodeLayer); s = buildmap_dictionary_add (DictionaryCity, (char *) ni.NodeName, strlen(ni.NodeName)); buildmap_place_add(s, ni.NodeLayer, point); @@ -327,7 +297,6 @@ buildmap_verbose("dropping %s %s", ni.NodePlace, ni.NodeName); } } -#endif buildmap_osm_text_reset_node(); } @@ -585,7 +554,7 @@ } -void +int buildmap_osm_get_layer(char *tag, char *value, int *flags, int *layer) { int i; @@ -600,13 +569,14 @@ *flags = list[i].flags; if (list[i].layerp) *layer = *(list[i].layerp); - break; + return 1; } } } break; } } + return 0; } /** @@ -631,29 +601,23 @@ if (s != 2) buildmap_fatal(0, "fail to scanf tag k and v (%s)", data); -#ifdef BEFORE - if (strcmp(tagk, "postal_code") == 0) { - /* <tag k="postal_code" v="3020"/> */ - if (ni.NodePostalCode) - free(ni.NodePostalCode); - ni.NodePostalCode = strdup(tagv); - if (catalog) { - saveInterestingNode(ni.NodeId); - // buildmap_verbose("saving node info k %s v %s", tagk, tagv); - } - } else -#endif - if (strcmp(tagk, "place") == 0) { - /* <tag k="place" v="town"/> */ + if (strcmp(tagk, "place") == 0 || /* <tag k="place" v="town"/> */ + strcmp(tagk, "amenity") == 0) { /* <tag k="amenity" v="fuel"/> */ if (ni.NodePlace) free(ni.NodePlace); ni.NodePlace = strdup(tagv); if (catalog) { saveInterestingNode(ni.NodeId); - // buildmap_verbose("saving node %u info k %s v %s", - // ni.NodeId, tagk, tagv); + buildmap_verbose("saving node %u info k %s v %s", + ni.NodeId, tagk, tagv); } - buildmap_osm_get_layer(tagk, tagv, &ni.NodeFlags, &ni.NodeLayer); + if (!buildmap_osm_get_layer(tagk, tagv, + &ni.NodeFlags, &ni.NodeLayer)) { + buildmap_verbose("no layer found for node %u info k %s v %s", + ni.NodeId, tagk, tagv); + } + buildmap_verbose("layer for node %u info k %s v %s is %d", + ni.NodeId, tagk, tagv, ni.NodeLayer); } else if (strcmp(tagk, "name") == 0) { /* <tag k="name" v="Herent"/> */ if (ni.NodeName) @@ -664,7 +628,7 @@ // buildmap_verbose("saving node %u info k %s v %s", ni.NodeId, tagk, tagv); } } else { - buildmap_debug("dropping node %u info k %s v%s", ni.NodeId, tagk, tagv); + buildmap_debug("dropping node %u info k %s v %s", ni.NodeId, tagk, tagv); } } Modified: trunk/roadmap/src/default/All =================================================================== --- trunk/roadmap/src/default/All 2015-05-31 23:08:03 UTC (rev 2810) +++ trunk/roadmap/src/default/All 2015-05-31 23:08:06 UTC (rev 2811) @@ -1,7 +1,7 @@ Class.Name: All Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries -Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls Nature Amenity -Class.Places: City Town Village Hamlet Suburbs +Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Schools Malls Nature Amenity +Class.Places: City Town Village Hamlet Suburbs Food Cafe Drinks Fuel ATM Class.NavigationModes: Car Bike Foot Boat Navigation.Car: Freeways Ramps Highways Streets Navigation.Bike: Streets Trails Shore Parks @@ -43,6 +43,7 @@ Railroads.Thickness: 1 Railroads.Speeds: 1 Rivers.Color: LightBlue +Rivers.LabelFontColor: DarkBlue Rivers.Declutter: 300 Rivers.Thickness: 3 Rivers.Speed: 1 @@ -58,6 +59,10 @@ Malls.Declutter: 300 Malls.Thickness: 1 Malls.Speed: 1 +Schools.Color: beige +Schools.Declutter: 300 +Schools.Thickness: 1 +Schools.Speed: 1 Airports.Color: grey Airports.Declutter: 300 Airports.Thickness: 1 @@ -91,14 +96,35 @@ Amenity.Thickness: 1 Amenity.Speed: 1 City.Color: red -City.Declutter 2000 +City.Declutter: 10001 +City.LabelFontColor: Brown Town.Color: red -Town.Declutter 1300 +Town.Declutter: 10002 +Town.LabelFontColor: Brown Village.Color: red -Village.Declutter 800 +Village.Declutter: 1300 +Village.LabelFontColor: Brown Hamlet.Color: red -Hamlet.Declutter 160 +Hamlet.Declutter: 10 +Hamlet.LabelFontColor: Brown Suburbs.Color: grey -Suburbs.Declutter: 300 +Suburbs.Declutter: 1300 +Suburbs.LabelFontColor: Brown Peak.Color: brown Peak.Declutter: 1000 + +Food.Color: pink +Food.Declutter: 1300 +Food.LabelFontColor: pink +Cafe.Color: aqua +Cafe.Declutter: 1300 +Cafe.LabelFontColor: aqua +Fuel.Color: grey +Fuel.Declutter: 1300 +Fuel.LabelFontColor: grey +Drinks.Color: blue +Drinks.Declutter: 1300 +Drinks.LabelFontColor: blue +ATM.Color: green +ATM.Declutter: 1300 +ATM.LabelFontColor: green This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:06
|
Revision: 2810 http://sourceforge.net/p/roadmap/code/2810 Author: pgf Date: 2015-05-31 23:08:03 +0000 (Sun, 31 May 2015) Log Message: ----------- finish disambiguating places and lines in the label cache Modified Paths: -------------- trunk/roadmap/src/navigate/navigate_plugin.c trunk/roadmap/src/roadmap_label.c trunk/roadmap/src/roadmap_plugin.c trunk/roadmap/src/roadmap_plugin.h Modified: trunk/roadmap/src/navigate/navigate_plugin.c =================================================================== --- trunk/roadmap/src/navigate/navigate_plugin.c 2015-05-31 23:08:00 UTC (rev 2809) +++ trunk/roadmap/src/navigate/navigate_plugin.c 2015-05-31 23:08:03 UTC (rev 2810) @@ -202,6 +202,7 @@ /* line_from */ NULL, /* line_to */ NULL, /* activate_db */ NULL, + /* activate_db_place */ NULL, /* get_distance */ NULL, /* override_line */ NULL, /* override_pen */ &navigate_visual_override_pen, Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:00 UTC (rev 2809) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:08:03 UTC (rev 2810) @@ -365,7 +365,17 @@ return roadmap_label_add_worker(1, point, line, pen, angle, featuresize_sq); } +int roadmap_label_same_thing(roadmap_label *cPtr, roadmap_label *ncPtr) { + if (cPtr->is_place != ncPtr->is_place) + return 0; + + if (cPtr->is_place) + return roadmap_plugin_same_place (&cPtr->place, &ncPtr->place); + else + return roadmap_plugin_same_line (&cPtr->line, &ncPtr->line); +} + int roadmap_label_draw_cache (int angles) { RoadMapListItem *item, *tmp; @@ -414,8 +424,7 @@ ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { ncPtr = (roadmap_label *)item2; - if ((!cPtr->is_place && roadmap_plugin_same_line (&cPtr->line, &ncPtr->line)) || - (cPtr->is_place && roadmap_plugin_same_place (&cPtr->place, &ncPtr->place))) { + if (roadmap_label_same_thing(cPtr, ncPtr)) { /* Found a new version of this existing place or line */ if (cPtr->notext) { @@ -476,6 +485,7 @@ if (cPtr->is_place) { const char *name; + roadmap_plugin_activate_db_place (&cPtr->place); name = roadmap_plugin_get_placename (&cPtr->place); if (!name) { cPtr->text = ""; @@ -485,16 +495,18 @@ #if LABEL_USING_LINEID { char buf[1000]; +#if 0 if (cPtr->place.place_id == 105 || cPtr->place.place_id == 65) { roadmap_log(ROADMAP_DEBUG, "arl or lex"); } +#endif sprintf(buf, "P%d %s", cPtr->place.place_id, cPtr->text); cPtr->otext = cPtr->text; cPtr->text = strdup(buf); } #endif - roadmap_log(ROADMAP_DEBUG, "place text is '%s' (%p)", cPtr->text, cPtr->text); + // roadmap_log(ROADMAP_DEBUG, "place text is '%s' (%p)", cPtr->text, cPtr); } else { PluginStreetProperties properties; roadmap_plugin_activate_db (&cPtr->line); Modified: trunk/roadmap/src/roadmap_plugin.c =================================================================== --- trunk/roadmap/src/roadmap_plugin.c 2015-05-31 23:08:00 UTC (rev 2809) +++ trunk/roadmap/src/roadmap_plugin.c 2015-05-31 23:08:03 UTC (rev 2810) @@ -300,7 +300,40 @@ } } +/** + * @brief + * @param line + * @return + */ +int roadmap_plugin_activate_db_place (const PluginPlace *place) { + if (place->plugin_id == ROADMAP_PLUGIN_ID) { + + if (roadmap_locator_activate (place->fips) != ROADMAP_US_OK) { + return -1; + } + + return 0; + + } else { + RoadMapPluginHooks *hp = get_hooks (place->plugin_id); + + if (hp == NULL) { + roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", + place->plugin_id); + + return -1; + } + + if (hp->activate_db != NULL) { + return (*hp->activate_db_place) (place); + } + + return 0; + } +} + + /** * @brief calculate the distance between a point and a line * @param point the point to use Modified: trunk/roadmap/src/roadmap_plugin.h =================================================================== --- trunk/roadmap/src/roadmap_plugin.h 2015-05-31 23:08:00 UTC (rev 2809) +++ trunk/roadmap/src/roadmap_plugin.h 2015-05-31 23:08:03 UTC (rev 2810) @@ -149,6 +149,7 @@ int street_id); int roadmap_plugin_activate_db (const PluginLine *line); +int roadmap_plugin_activate_db_place (const PluginPlace *place); int roadmap_plugin_get_distance (RoadMapPosition *point, PluginLine *line, @@ -167,6 +168,7 @@ typedef void (*plugin_screen_repaint_hook) (int max_pen); typedef int (*plugin_activate_db_func) (const PluginLine *line); +typedef int (*plugin_activate_db_func_place) (const PluginPlace *place); typedef void (*plugin_line_pos_func) (const PluginLine *line, RoadMapPosition *pos); @@ -228,6 +230,7 @@ plugin_line_pos_func line_from; plugin_line_pos_func line_to; plugin_activate_db_func activate_db; + plugin_activate_db_func_place activate_db_place; plugin_get_distance_func get_distance; plugin_override_line_hook override_line; plugin_override_pen_hook override_pen; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:08:02
|
Revision: 2809 http://sourceforge.net/p/roadmap/code/2809 Author: pgf Date: 2015-05-31 23:08:00 +0000 (Sun, 31 May 2015) Log Message: ----------- typo in naming Modified Paths: -------------- trunk/roadmap/src/roadmap_line.c Modified: trunk/roadmap/src/roadmap_line.c =================================================================== --- trunk/roadmap/src/roadmap_line.c 2015-05-31 23:07:57 UTC (rev 2808) +++ trunk/roadmap/src/roadmap_line.c 2015-05-31 23:08:00 UTC (rev 2809) @@ -279,7 +279,7 @@ } roadmap_db_handler RoadMapLineHandler = { - "dictionary", + "line", roadmap_line_map, roadmap_line_activate, roadmap_line_unmap This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:07:59
|
Revision: 2808 http://sourceforge.net/p/roadmap/code/2808 Author: pgf Date: 2015-05-31 23:07:57 +0000 (Sun, 31 May 2015) Log Message: ----------- eliminate the ROADMAP_ADVANCED_STYLE ifdef there are still probably too many layer controls for my taste, but the stubs are cheap, and i do want at least color, and probably size. Modified Paths: -------------- trunk/roadmap/src/agg_support/roadmap_canvas.cpp trunk/roadmap/src/android/roadmap_canvas.c trunk/roadmap/src/config.mk trunk/roadmap/src/gtk/roadmap_canvas.c trunk/roadmap/src/gtk2/roadmap_canvas.c trunk/roadmap/src/iphone/roadmap_canvas.m trunk/roadmap/src/options.mk trunk/roadmap/src/qt/roadmap_canvas.cc trunk/roadmap/src/qt4/qt_canvas.cc trunk/roadmap/src/qt4/qt_canvas.h trunk/roadmap/src/qt4/roadmap_canvas.cc trunk/roadmap/src/roadmap_canvas.h trunk/roadmap/src/roadmap_label.c trunk/roadmap/src/roadmap_label.h trunk/roadmap/src/roadmap_landmark.c trunk/roadmap/src/roadmap_layer.c trunk/roadmap/src/win32/roadmap_canvas.c Modified: trunk/roadmap/src/agg_support/roadmap_canvas.cpp =================================================================== --- trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:07:57 UTC (rev 2808) @@ -298,7 +298,6 @@ roadmap_canvas_select_pen(CurrentPen); } -#if defined(ROADMAP_ADVANCED_STYLE) /* this are stubs */ void roadmap_canvas_set_linejoin(const char *join) {} void roadmap_canvas_set_linecap(const char *cap) {} @@ -315,7 +314,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { Modified: trunk/roadmap/src/android/roadmap_canvas.c =================================================================== --- trunk/roadmap/src/android/roadmap_canvas.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/android/roadmap_canvas.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -645,7 +645,6 @@ /* FIX ME what to do with return value */ } -#if defined(ROADMAP_ADVANCED_STYLE) /* these are stubs */ void roadmap_canvas_set_opacity (int opacity) {} @@ -665,7 +664,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ /** * @brief initialize the roadmap_canvas private variables Modified: trunk/roadmap/src/config.mk =================================================================== --- trunk/roadmap/src/config.mk 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/config.mk 2015-05-31 23:07:57 UTC (rev 2808) @@ -169,10 +169,6 @@ # # if you want roadmap to translate the GUI enable this # LANGS = YES -# Advanced style (only qt4 supports this for now) -# # Adds support to more control on the map drawings -ADVANCED_STYLE = YES - # Basic building mode MODE = # blank for "normal" build # MODE=DEBUG # enables -g, disables -O Modified: trunk/roadmap/src/gtk/roadmap_canvas.c =================================================================== --- trunk/roadmap/src/gtk/roadmap_canvas.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/gtk/roadmap_canvas.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -197,7 +197,6 @@ GDK_JOIN_ROUND); } -#if defined(ROADMAP_ADVANCED_STYLE) /* this are stubs */ void roadmap_canvas_set_opacity (int opacity) {} @@ -217,7 +216,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { Modified: trunk/roadmap/src/gtk2/roadmap_canvas.c =================================================================== --- trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/gtk2/roadmap_canvas.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -199,7 +199,6 @@ GDK_JOIN_ROUND); } -#if defined(ROADMAP_ADVANCED_STYLE) /* this are stubs */ void roadmap_canvas_set_opacity (int opacity) {} @@ -219,7 +218,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { Modified: trunk/roadmap/src/iphone/roadmap_canvas.m =================================================================== --- trunk/roadmap/src/iphone/roadmap_canvas.m 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/iphone/roadmap_canvas.m 2015-05-31 23:07:57 UTC (rev 2808) @@ -314,7 +314,6 @@ CurrentPen->lineWidth = thickness * 1.0; } -#if defined(ROADMAP_ADVANCED_STYLE) /* this are stubs */ void roadmap_canvas_set_opacity (int opacity) {} @@ -334,7 +333,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { /* 'erase' means fill the canvas with the foreground color */ Modified: trunk/roadmap/src/options.mk =================================================================== --- trunk/roadmap/src/options.mk 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/options.mk 2015-05-31 23:07:57 UTC (rev 2808) @@ -122,10 +122,6 @@ CFLAGS += -DLANG_SUPPORT endif -ifneq ($(strip $(ADVANCED_STYLE)),) - CFLAGS += -DROADMAP_ADVANCED_STYLE -endif - ifeq ($(strip $(MODE)),DEBUG) CFLAGS += -g Modified: trunk/roadmap/src/qt/roadmap_canvas.cc =================================================================== --- trunk/roadmap/src/qt/roadmap_canvas.cc 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/qt/roadmap_canvas.cc 2015-05-31 23:07:57 UTC (rev 2808) @@ -115,7 +115,6 @@ roadMapCanvas->setPenThickness(thickness); } -#if defined(ROADMAP_ADVANCED_STYLE) /* this are stubs */ void roadmap_canvas_set_opacity (int opacity) {} @@ -135,7 +134,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { roadMapCanvas->erase(); Modified: trunk/roadmap/src/qt4/qt_canvas.cc =================================================================== --- trunk/roadmap/src/qt4/qt_canvas.cc 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/qt4/qt_canvas.cc 2015-05-31 23:07:57 UTC (rev 2808) @@ -80,7 +80,6 @@ QPen* pen = new QPen(Qt::SolidLine/*Qt::DotLine*/); p->pen = pen; p->font = new QFont("Arial",12); -#if defined(ROADMAP_ADVANCED_STYLE) p->brush = new QBrush(); p->fontcolor = new QColor("#000000"); p->capitalize = 0; @@ -89,7 +88,6 @@ p->buffercolor = new QColor("#ffffff"); p->pen->setJoinStyle(Qt::RoundJoin); p->pen->setCapStyle(Qt::RoundCap); -#endif pens.insert(name, p); } @@ -141,7 +139,6 @@ } } -#if defined(ROADMAP_ADVANCED_STYLE) int RMapCanvas::getPenThickness(RoadMapPen p) { if (p != 0) { return (int) p->pen->width(); @@ -289,7 +286,6 @@ int RMapCanvas::getFontBufferSize(RoadMapPen pen) { return pen->buffersize; } -#endif /* ROADMAP_ADVANCED_STYLE */ void RMapCanvas::erase() { if (pixmap) { @@ -301,7 +297,10 @@ p.setPen(*currentPen->pen); p.setFont(*currentPen->font); -#if defined(ROADMAP_ADVENCED_STYLE) +// when i removed all of the ROADMAP_ADVANCED_STYLE ifdefs, i found +// this. i'm going to enable the code, but since the ifdef was +// misspelled, the code may never have been tested. +#if 1 // defined(ROADMAP_ADVENCED_STYLE) if (currentPen->background) { p.setBackground(*currentPen->brush); p.setBackgroundMode(Qt::OpaqueMode); @@ -315,11 +314,7 @@ void RMapCanvas::getTextExtents(const char* text, int* w, int* ascent, int* descent, int *can_tilt) { -#if defined(ROADMAP_ADVANCED_STYLE) QFontMetrics fm(*currentPen->font); -#else - QFontMetrics fm(*currentPen->font); -#endif QRect r = fm.boundingRect(QString::fromUtf8(text)); @@ -366,7 +361,6 @@ else /* TOP */ y += text_ascent; -#if defined(ROADMAP_ADVANCED_STYLE) if (currentPen != 0) { /* draw the buffer */ if (currentPen->buffersize!=0) { @@ -383,7 +377,6 @@ pen.setColor(*currentPen->fontcolor); p.setPen(pen); } -#endif p.drawText(x, y, QString::fromUtf8(text)); } @@ -408,7 +401,6 @@ p.translate(position->x,position->y); p.rotate((double)angle); -#if defined(ROADMAP_ADVANCED_STYLE) if (currentPen != 0) { if (currentPen->buffersize!=0) { QPen pen(p.pen()); @@ -424,7 +416,6 @@ pen.setColor(*currentPen->fontcolor); p.setPen(pen); } -#endif /* ROADMAP_ADVANCED_STYLE */ p.drawText(-text_width/2, -text_descent, QString::fromUtf8(text)); #endif @@ -477,7 +468,6 @@ if (currentPen != 0) { if (filled && !fast_draw) { p.setPen(*currentPen->pen); -#if defined(ROADMAP_ADVANCED_STYLE) if (currentPen->background) { p.setBackground(*currentPen->brush); p.setBackgroundMode(Qt::OpaqueMode); @@ -488,9 +478,6 @@ p.setBrush(*currentPen->brush); } } -#else - p.setBrush(QColor(currentPen->pen->color())); -#endif } else { p.setPen(*currentPen->pen); } @@ -518,7 +505,6 @@ if (currentPen != 0) { if (filled) { p.setPen(*currentPen->pen); -#if defined(ROADMAP_ADVANCED_STYLE) if (currentPen->background) { p.setBackground(*currentPen->brush); p.setBackgroundMode(Qt::OpaqueMode); @@ -529,9 +515,6 @@ p.setBrush(*currentPen->brush); } } -#else - p.setBrush(QBrush(currentPen->pen->color())); -#endif } else { p.setPen(*currentPen->pen); } Modified: trunk/roadmap/src/qt4/qt_canvas.h =================================================================== --- trunk/roadmap/src/qt4/qt_canvas.h 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/qt4/qt_canvas.h 2015-05-31 23:07:57 UTC (rev 2808) @@ -42,14 +42,12 @@ struct roadmap_canvas_pen { QPen* pen; QFont* font; -#if defined(ROADMAP_ADVANCED_STYLE) QBrush* brush; int capitalize; int background; QColor* fontcolor; QColor* buffercolor; int buffersize; -#endif }; }; @@ -68,7 +66,6 @@ void setPenThickness(int thickness); void setFontSize(int size); -#if defined(ROADMAP_ADVANCED_STYLE) int getPenThickness(RoadMapPen p); void setPenOpacity(int opacity); void setPenLighter(int factor); @@ -91,7 +88,6 @@ void setFontBufferColor(const char *color); void setFontBufferSize(int size); int getFontBufferSize(RoadMapPen pen); -#endif /* ROADMAP_ADVANCED_STYLE */ void erase(void); void setupPainterPen(QPainter &p); Modified: trunk/roadmap/src/qt4/roadmap_canvas.cc =================================================================== --- trunk/roadmap/src/qt4/roadmap_canvas.cc 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/qt4/roadmap_canvas.cc 2015-05-31 23:07:57 UTC (rev 2808) @@ -85,9 +85,6 @@ void roadmap_canvas_get_text_extents(const char *text, int size, int *width, int *ascent, int *descent, int *can_tilt) { -#if !defined(ROADMAP_ADVANCED_STYLE) - roadMapCanvas->setFontSize(size); -#endif roadMapCanvas->getTextExtents(text, width, ascent, descent, can_tilt); } @@ -121,7 +118,6 @@ roadMapCanvas->erase(); } -#if defined(ROADMAP_ADVANCED_STYLE) int roadmap_canvas_get_thickness (RoadMapPen pen) { return roadMapCanvas->getPenThickness(pen); } @@ -271,15 +267,11 @@ return roadMapCanvas->getFontBufferSize(pen); } -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_draw_string(RoadMapGuiPoint *position, int corner, int size, const char *text) { -#if !defined(ROADMAP_ADVANCED_STYLE) - roadMapCanvas->setFontSize(size); -#endif roadMapCanvas->drawString(position, corner, text); } @@ -288,9 +280,6 @@ int angle, const char *text) { -#if !defined(ROADMAP_ADVANCED_STYLE) - roadMapCanvas->setFontSize(size); -#endif roadMapCanvas->drawStringAngle(position, 0, text, angle); } Modified: trunk/roadmap/src/roadmap_canvas.h =================================================================== --- trunk/roadmap/src/roadmap_canvas.h 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/roadmap_canvas.h 2015-05-31 23:07:57 UTC (rev 2808) @@ -96,12 +96,6 @@ void roadmap_canvas_set_opacity (int opacity); void roadmap_canvas_set_linestyle (const char *style); -#if defined(ROADMAP_ADVANCED_STYLE) - -/* This is a set of functions which enable advanced display of the map - * and improves the overall map experience - */ - void roadmap_canvas_set_linejoin(const char *join); void roadmap_canvas_set_linecap(const char *cap); @@ -119,8 +113,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color); void roadmap_canvas_set_label_buffer_size(int size); -#endif - /* The functions below draw in the selected buffer using the selected pen: */ void roadmap_canvas_erase (void); Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -234,24 +234,15 @@ return angle; } -#if defined(ROADMAP_ADVANCED_STYLE) void roadmap_label_draw_text(const char *text, RoadMapGuiPoint *pos, int doing_angles, int angle, RoadMapPen pen) { int size = RoadMapLabelFontSize; -#else -void roadmap_label_draw_text(const char *text, - RoadMapGuiPoint *pos, - int doing_angles, int angle, int size) -{ -#endif -#if defined(ROADMAP_ADVANCED_STYLE) if (pen!=0) roadmap_canvas_select_pen (pen); else -#endif roadmap_canvas_select_pen (RoadMapLabelPen); if (doing_angles) { @@ -700,17 +691,10 @@ "KK: %p: t: %s, w: %d, fsq: %d, ang: %d", cPtr, cPtr->text, width, cPtr->featuresize_sq, cPtr->angle); -#if defined(ROADMAP_ADVANCED_STYLE) roadmap_label_draw_text (cPtr->text, &cPtr->center_point, angles, angles ? cPtr->angle : 0, cPtr->pen ); -#else - roadmap_label_draw_text - (cPtr->text, &cPtr->center_point, - angles, angles ? cPtr->angle : 0, - RoadMapLabelFontSize ); -#endif if (whichlist == NEWLIST) { /* move the rendered label to the cache */ Modified: trunk/roadmap/src/roadmap_label.h =================================================================== --- trunk/roadmap/src/roadmap_label.h 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/roadmap_label.h 2015-05-31 23:07:57 UTC (rev 2808) @@ -44,15 +44,9 @@ void roadmap_label_start (void); -#if defined(ROADMAP_ADVANCED_STYLE) void roadmap_label_draw_text(const char *text, RoadMapGuiPoint *pos, int doing_angles, int angle, RoadMapPen pen); -#else -void roadmap_label_draw_text(const char *text, - RoadMapGuiPoint *pos, - int doing_angles, int angle, int size); -#endif void roadmap_label_cache_invalidate(void); void roadmap_label_new_invalidate(void); Modified: trunk/roadmap/src/roadmap_landmark.c =================================================================== --- trunk/roadmap/src/roadmap_landmark.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/roadmap_landmark.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -99,13 +99,8 @@ * should probably be drawn last, however, so that their * labels come out on "top" of other map features. */ -#if defined(ROADMAP_ADVANCED_STYLE) roadmap_label_draw_text(waypointp->shortname, &guipoint, 0, 0, pen); -#else - roadmap_label_draw_text(waypointp->shortname, - &guipoint, 0, 0, RoadMapLandmarkFontSize); -#endif } } @@ -139,13 +134,8 @@ * should probably be drawn last, however, so that their * labels come out on "top" of other map features. */ -#if defined(ROADMAP_ADVANCED_STYLE) roadmap_label_draw_text(weepointp->name, &guipoint, 0, 0, pen); -#else - roadmap_label_draw_text(weepointp->name, - &guipoint, 0, 0, RoadMapLandmarkFontSize); -#endif } } Modified: trunk/roadmap/src/roadmap_layer.c =================================================================== --- trunk/roadmap/src/roadmap_layer.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/roadmap_layer.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -201,7 +201,6 @@ /* {"Delta", ROADMAP_STYLE_TYPE_INT, "", roadmap_canvas_set_thickness}, */ {"Color", ROADMAP_STYLE_TYPE_STRING, "#000000", roadmap_canvas_set_foreground}, {"Style", ROADMAP_STYLE_TYPE_STRING, "", roadmap_canvas_set_linestyle}, -#if defined(ROADMAP_ADVANCED_STYLE) {"LineCap", ROADMAP_STYLE_TYPE_STRING, "", roadmap_canvas_set_linecap }, {"LineJoin", ROADMAP_STYLE_TYPE_STRING, "", roadmap_canvas_set_linejoin }, {"Opacity", ROADMAP_STYLE_TYPE_INT, "", roadmap_canvas_set_opacity }, @@ -216,7 +215,6 @@ {"LabelFontSpacing", ROADMAP_STYLE_TYPE_INT, "", roadmap_canvas_set_label_font_spacing }, {"LabelBufferColor", ROADMAP_STYLE_TYPE_STRING, "", roadmap_canvas_set_label_buffer_color }, {"LabelBufferSize", ROADMAP_STYLE_TYPE_INT, "", roadmap_canvas_set_label_buffer_size }, -#endif /* ADVANCED STYLE */ }; Modified: trunk/roadmap/src/win32/roadmap_canvas.c =================================================================== --- trunk/roadmap/src/win32/roadmap_canvas.c 2015-05-31 23:07:53 UTC (rev 2807) +++ trunk/roadmap/src/win32/roadmap_canvas.c 2015-05-31 23:07:57 UTC (rev 2808) @@ -199,8 +199,6 @@ roadmap_canvas_select_pen(CurrentPen); } -#if defined(ROADMAP_ADVANCED_STYLE) -/* this are stubs */ void roadmap_canvas_set_opacity (int opacity) {} void roadmap_canvas_set_linejoin(const char *join) {} @@ -219,7 +217,6 @@ void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} -#endif /* ROADMAP_ADVANCED_STYLE */ void roadmap_canvas_erase (void) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:07:55
|
Revision: 2807 http://sourceforge.net/p/roadmap/code/2807 Author: pgf Date: 2015-05-31 23:07:53 +0000 (Sun, 31 May 2015) Log Message: ----------- enable colored label pens for gtk2 agg Modified Paths: -------------- trunk/roadmap/src/agg_support/roadmap_canvas.cpp trunk/roadmap/src/config.mk Modified: trunk/roadmap/src/agg_support/roadmap_canvas.cpp =================================================================== --- trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:07:50 UTC (rev 2806) +++ trunk/roadmap/src/agg_support/roadmap_canvas.cpp 2015-05-31 23:07:53 UTC (rev 2807) @@ -111,6 +111,8 @@ char *name; char *color_name; agg::rgba8 color; + char *font_color_name; + agg::rgba8 font_color; int thickness; }; @@ -233,8 +235,10 @@ roadmap_check_allocated(pen); pen->name = strdup (name); - pen->color_name = 0; - pen->color = agg::rgba8(0, 0, 0); + pen->font_color_name = + pen->color_name = 0; + pen->font_color = + pen->color = agg::rgba8(0, 0, 0); pen->thickness = 1; pen->next = RoadMapPenList; @@ -255,6 +259,14 @@ roadmap_canvas_select_pen(CurrentPen); } +void roadmap_canvas_set_label_font_color(const char *color) { + + if (!CurrentPen) return; + CurrentPen->font_color_name = strdup (color); + CurrentPen->font_color = roadmap_canvas_agg_parse_color(color); + roadmap_canvas_select_pen(CurrentPen); +} + void roadmap_canvas_set_linestyle (const char *style) { // unimplemented @@ -296,7 +308,6 @@ void roadmap_canvas_set_brush_isbackground(int isbackground) {} void roadmap_canvas_set_label_font_name(const char *name) {} -void roadmap_canvas_set_label_font_color(const char *color) {} void roadmap_canvas_set_label_font_size(int size) {} void roadmap_canvas_set_label_font_spacing(int spacing) {} void roadmap_canvas_set_label_font_weight(const char *weight) {} @@ -648,7 +659,7 @@ const wchar_t* p = wstr; #endif - ren_solid.color(CurrentPen->color); + ren_solid.color(CurrentPen->font_color); dbg_time_end(DBG_TIME_TEXT_CNV); dbg_time_start(DBG_TIME_TEXT_LOAD); @@ -906,7 +917,7 @@ const wchar_t* p = wstr; #endif - ren_solid.color(CurrentPen->color); + ren_solid.color(CurrentPen->font_color); double x = position->x; double y = position->y + size - 7; Modified: trunk/roadmap/src/config.mk =================================================================== --- trunk/roadmap/src/config.mk 2015-05-31 23:07:50 UTC (rev 2806) +++ trunk/roadmap/src/config.mk 2015-05-31 23:07:53 UTC (rev 2807) @@ -171,7 +171,7 @@ # Advanced style (only qt4 supports this for now) # # Adds support to more control on the map drawings -# ADVANCED_STYLE = YES +ADVANCED_STYLE = YES # Basic building mode MODE = # blank for "normal" build This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:07:52
|
Revision: 2806 http://sourceforge.net/p/roadmap/code/2806 Author: pgf Date: 2015-05-31 23:07:50 +0000 (Sun, 31 May 2015) Log Message: ----------- roadmap_screen: don't leak SquareOnScreen map it's benign, but looks bad in valgrind Modified Paths: -------------- trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:07:47 UTC (rev 2805) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:07:50 UTC (rev 2806) @@ -2451,6 +2451,7 @@ RoadMapScreenDeltaX = 0; RoadMapScreenDeltaY = 0; + if (SquareOnScreen) free(SquareOnScreen); SquareOnScreen = NULL; SquareOnScreenCount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pg...@us...> - 2015-05-31 23:07:49
|
Revision: 2805 http://sourceforge.net/p/roadmap/code/2805 Author: pgf Date: 2015-05-31 23:07:47 +0000 (Sun, 31 May 2015) Log Message: ----------- cleanup place code a couple of bugs, remove some unneeded ifdefs, compress some redundant code Modified Paths: -------------- trunk/roadmap/src/roadmap_label.c trunk/roadmap/src/roadmap_label.h trunk/roadmap/src/roadmap_place.c trunk/roadmap/src/roadmap_screen.c Modified: trunk/roadmap/src/roadmap_label.c =================================================================== --- trunk/roadmap/src/roadmap_label.c 2015-05-31 23:07:43 UTC (rev 2804) +++ trunk/roadmap/src/roadmap_label.c 2015-05-31 23:07:47 UTC (rev 2805) @@ -114,9 +114,7 @@ RoadMapGuiRect bbox; /* label bounding box */ RoadMapGuiPoint poly[4]; -#if defined(ROADMAP_ADVANCED_STYLE) RoadMapPen pen; -#endif unsigned short zoom; short angle; /* degrees */ @@ -295,19 +293,14 @@ } -#if defined(ROADMAP_ADVANCED_STYLE) -int roadmap_label_add (const RoadMapGuiPoint *point, int angle, - int featuresize_sq, const PluginLine *line, - RoadMapPen pen) { -#else -int roadmap_label_add (const RoadMapGuiPoint *point, int angle, - int featuresize_sq, const PluginLine *line) { -#endif - PluginPlace noplace = {ROADMAP_PLUGIN_ID, 0, 0, 0}; +int roadmap_label_add_worker (int is_line, const RoadMapGuiPoint *point, + const void *pluginptr, RoadMapPen pen, int angle, int featuresize_sq) { + PluginPlace nowhere = {ROADMAP_PLUGIN_ID, 0, 0, 0}; + roadmap_label *cPtr = 0; - if (featuresize_sq < RoadMapLabelMinFeatSizeSq) { + if (is_line && featuresize_sq < RoadMapLabelMinFeatSizeSq) { return -1; } @@ -330,22 +323,29 @@ RoadMapLabelCacheAlloced++; } + if (is_line) { + cPtr->is_place = 0; + cPtr->line = *(PluginLine *)pluginptr; + cPtr->place = *(PluginPlace *)&nowhere; + cPtr->featuresize_sq = featuresize_sq; + cPtr->angle = normalize_angle(angle); + } else { + cPtr->is_place = 1; + cPtr->place = *(PluginPlace *)pluginptr; + cPtr->line = *(PluginLine *)&nowhere; + cPtr->featuresize_sq = 999999; + cPtr->angle = 0; + } + + cPtr->notext = 0; cPtr->text = NULL; cPtr->bbox.minx = 1; cPtr->bbox.maxx = -1; - cPtr->is_place = 0; - cPtr->place = noplace; - cPtr->line = *line; - cPtr->featuresize_sq = featuresize_sq; - cPtr->angle = normalize_angle(angle); - cPtr->center_point = *point; -#if defined(ROADMAP_ADVANCED_STYLE) cPtr->pen = pen; -#endif /* The stored point is not screen oriented, rotate is needed */ roadmap_math_rotate_coordinates (1, &cPtr->center_point); @@ -363,69 +363,18 @@ return 0; } -#if defined(ROADMAP_ADVANCED_STYLE) int roadmap_label_add_place (const RoadMapGuiPoint *point, const PluginPlace *place, RoadMapPen pen) { -#else -int roadmap_label_add_place (const RoadMapGuiPoint *point, - const PluginPlace *place) { -#endif - PluginLine noline = {ROADMAP_PLUGIN_ID, 0, 0, 0}; + return roadmap_label_add_worker(0, point, place, pen, 0, 0); +} - roadmap_label *cPtr = 0; +int roadmap_label_add_line (const RoadMapGuiPoint *point, int angle, + int featuresize_sq, const PluginLine *line, + RoadMapPen pen) { + return roadmap_label_add_worker(1, point, line, pen, angle, featuresize_sq); +} - if (!ROADMAP_LIST_EMPTY(&RoadMapLabelSpares)) { - cPtr = (roadmap_label *)roadmap_list_remove - (ROADMAP_LIST_FIRST(&RoadMapLabelSpares)); - if (cPtr->text && *cPtr->text) { - free(cPtr->text); - } - } else { - if (RoadMapLabelCacheFull) return -1; - if (RoadMapLabelCacheAlloced == MAX_LABELS) { - roadmap_log (ROADMAP_WARNING, "Not enough room for labels."); - RoadMapLabelCacheFull = 1; - return -1; - } - cPtr = malloc (sizeof (*cPtr)); - roadmap_check_allocated (cPtr); - RoadMapLabelCacheAlloced++; - } - - cPtr->notext = 0; - cPtr->text = NULL; - - cPtr->bbox.minx = 1; - cPtr->bbox.maxx = -1; - - cPtr->is_place = 1; - cPtr->place = *place; - cPtr->line = noline; - cPtr->featuresize_sq = 9999; - cPtr->angle = 0; - - cPtr->center_point = *point; -#if defined(ROADMAP_ADVANCED_STYLE) - cPtr->pen = pen; -#endif - - /* The stored point is not screen oriented, rotate is needed */ - roadmap_math_rotate_coordinates (1, &cPtr->center_point); - - - /* the "generation" of a label is refreshed when it is re-added. - * later, labels cache entries can be aged, and discarded. - */ - cPtr->gen = RoadMapLabelGeneration; - - cPtr->zoom = RoadMapLabelCurrentZoom; - - roadmap_list_append(&RoadMapLabelNew, &cPtr->link); - - return 0; -} - int roadmap_label_draw_cache (int angles) { RoadMapListItem *item, *tmp; @@ -544,8 +493,12 @@ } #if LABEL_USING_LINEID { - char buf[40]; - sprintf(buf, "x%d", cPtr->place.place_id); + char buf[1000]; + if (cPtr->place.place_id == 105 || + cPtr->place.place_id == 65) { + roadmap_log(ROADMAP_DEBUG, "arl or lex"); + } + sprintf(buf, "P%d %s", cPtr->place.place_id, cPtr->text); cPtr->otext = cPtr->text; cPtr->text = strdup(buf); } @@ -563,8 +516,9 @@ } #if LABEL_USING_LINEID { - char buf[40]; + char buf[1000]; sprintf(buf, "%d", cPtr->line.line_id); + sprintf(buf, "L%d %s", cPtr->line.line_id, cPtr->text); cPtr->otext = cPtr->text; cPtr->text = strdup(buf); } @@ -688,7 +642,8 @@ } /* street already labelled */ - if(roadmap_plugin_same_street(&cPtr->street, &ocPtr->street)) { + if(!cPtr->is_place && !ocPtr->is_place && + roadmap_plugin_same_street(&cPtr->street, &ocPtr->street)) { cannot_label = 1; /* label is a duplicate */ break; } Modified: trunk/roadmap/src/roadmap_label.h =================================================================== --- trunk/roadmap/src/roadmap_label.h 2015-05-31 23:07:43 UTC (rev 2804) +++ trunk/roadmap/src/roadmap_label.h 2015-05-31 23:07:47 UTC (rev 2805) @@ -31,18 +31,11 @@ #include "roadmap_plugin.h" -#if defined(ROADMAP_ADVANCED_STYLE) -int roadmap_label_add (const RoadMapGuiPoint *point, int angle, +int roadmap_label_add_line (const RoadMapGuiPoint *point, int angle, int featuresize, const PluginLine *line, RoadMapPen pen); int roadmap_label_add_place (const RoadMapGuiPoint *point, const PluginPlace *place, RoadMapPen pen); -#else -int roadmap_label_add (const RoadMapGuiPoint *point, int angle, - int featuresize, const PluginLine *line); -int roadmap_label_add_place (const RoadMapGuiPoint *point, - const PluginPlace *place); -#endif int roadmap_label_activate (void); int roadmap_label_initialize (void); Modified: trunk/roadmap/src/roadmap_place.c =================================================================== --- trunk/roadmap/src/roadmap_place.c 2015-05-31 23:07:43 UTC (rev 2804) +++ trunk/roadmap/src/roadmap_place.c 2015-05-31 23:07:47 UTC (rev 2805) @@ -154,12 +154,14 @@ RoadMapPlaceContext *place_context = (RoadMapPlaceContext *) context; - if (place_context && place_context->type != RoadMapPlaceType) { - roadmap_log (ROADMAP_FATAL, "invalid place context activated"); + if (place_context) { + + if (place_context->type != RoadMapPlaceType) { + roadmap_log (ROADMAP_FATAL, "invalid place context activated"); + } else if (place_context->PlaceNames == NULL) { + place_context->PlaceNames = roadmap_dictionary_open ("city"); + } } - if (place_context->PlaceNames == NULL) { - place_context->PlaceNames = roadmap_dictionary_open ("city"); - } RoadMapPlaceActive = place_context; } Modified: trunk/roadmap/src/roadmap_screen.c =================================================================== --- trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:07:43 UTC (rev 2804) +++ trunk/roadmap/src/roadmap_screen.c 2015-05-31 23:07:47 UTC (rev 2805) @@ -1032,14 +1032,9 @@ cutoff_dist > roadmap_math_screen_distance (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; -#if defined(ROADMAP_ADVANCED_STYLE) - roadmap_label_add + roadmap_label_add_line (&seg_middle, angle_ptr ? *angle_ptr : 90, *total_length_ptr, &l, pen); -#else - roadmap_label_add - (&seg_middle, angle_ptr ? *angle_ptr : 90, *total_length_ptr, &l); -#endif } return 1; @@ -1308,11 +1303,7 @@ !RoadMapScreenDragging && RoadMapScreenLabels) { PluginPlace p = {ROADMAP_PLUGIN_ID, place, layer, fips}; -#if defined(ROADMAP_ADVANCED_STYLE) roadmap_label_add_place (&guipoint, &p, layer_pen); -#else - roadmap_label_add_place (&guipoint, &p); -#endif drawn += 1; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |