Index: Classdef.h ================================================================== --- Classdef.h +++ Classdef.h @@ -283,14 +283,14 @@ void DrawLinestring(wxGraphicsContext * gr, wxColour & colour, gaiaGeomCollPtr geom, bool railways = false); void DrawRasterLayer(wxGraphicsContext * gr, int layer); void DrawDynamicGeometry(wxGraphicsContext * gr, int thick); void DrawDistanceMarker(wxGraphicsContext * gr, double x, double y); - void ComputePlanarDistance(double *length); + void ComputePlanarDistance(); bool ComputePlanarLength(double *length); void DrawDistancePath(wxGraphicsContext * gr); - void ComputeGreatCircleArc(double *great_circle, double *geodesic); + void ComputeGreatCircleArc(); bool ComputeGreatCircleLength(double *great_circle, double *geodesic); bool GetRaster(void *handle, wxBitmap * bmp); void DragMap(int x, int y); void OnTheFlyIdentify(int mouse_x, int mouse_y); void ShowMapTip(wxString & label, int x, int y, int category); Index: Main.cpp ================================================================== --- Main.cpp +++ Main.cpp @@ -1266,11 +1266,11 @@ toolBar->EnableTool(ID_Distance, true); toolBar->EnableTool(ID_ZoomIn, true); toolBar->EnableTool(ID_ZoomOut, true); toolBar->EnableTool(ID_Pan, true); toolBar->EnableTool(ID_Graticule, HasGraticule()); - if (current_map > 0) + if (current_map < 0) toolBar->ToggleTool(current_map, true); toolBar->ToggleTool(ID_ZoomIn, true); MapView->SetFullExtent(); MapView->PrepareMap(); } Index: MapView.cpp ================================================================== --- MapView.cpp +++ MapView.cpp @@ -673,23 +673,13 @@ menu->Enable(ID_October, false); } if (MainFrame->HasGraticule() == false) menu->Enable(ID_Graticule, false); // setting items state - if (MainFrame->HasCountries() == true || MainFrame->HasAdminAreas() == true) - ; - else - menu->Enable(ID_Political, false); menu->Check(ID_Political, MainFrame->IsPoliticalMap()); - if (MainFrame->GetSatelliteHandle() == NULL) - menu->Enable(ID_Satellite, false); menu->Check(ID_Satellite, MainFrame->IsSatelliteMap()); - if (MainFrame->GetReliefHandle() == NULL) - menu->Enable(ID_Relief, false); menu->Check(ID_Relief, MainFrame->IsReliefMap()); - if (MainFrame->GetBathymetryHandle() == NULL) - menu->Enable(ID_Bathymetry, false); menu->Check(ID_Bathymetry, MainFrame->IsBathymetryMap()); if (MainFrame->IsTMeanJanMap() || MainFrame->IsTMeanAprMap() || MainFrame->IsTMeanJulMap() || MainFrame->IsTMeanOctMap()) menu->Check(ID_Temperature, true); if (MainFrame->IsRainJanMap() || MainFrame->IsRainAprMap() @@ -1361,14 +1351,10 @@ } void MyMapView::ResetScreenBitmap() { // copying the MapBitmap into the ScreenBitmap - double great_circle; - double geodesic; - double length; - bool showDistance = false; wxMemoryDC *mapDc = new wxMemoryDC(MapBitmap); wxMemoryDC *dynDc = new wxMemoryDC(DynamicMapBitmap); dynDc->Blit(0, 0, BitmapWidth, BitmapHeight, mapDc, 0, 0); delete mapDc; if (MainFrame->IsModeDistance() == false) @@ -1398,34 +1384,11 @@ { wxGraphicsContext *gr = wxGraphicsContext::Create(*dynDc); DrawDynamicGeometry(gr, 3); delete gr; } - if (DistanceX2 != DBL_MAX && DistanceY2 != DBL_MAX - && DistanceX1 != DBL_MAX && DistanceY1 != DBL_MAX) - { - - if (MainFrame->IsGeographic() == true) - ComputeGreatCircleArc(&great_circle, &geodesic); - else - ComputePlanarDistance(&length); - wxGraphicsContext *gr = wxGraphicsContext::Create(*dynDc); - DrawDistancePath(gr); - DrawDistanceMarker(gr, DistanceX1, DistanceY1); - DrawDistanceMarker(gr, DistanceX2, DistanceY2); - delete gr; - DistanceX2 = DBL_MAX; - DistanceY2 = DBL_MAX; - DistanceX1 = DBL_MAX; - DistanceY1 = DBL_MAX; - showDistance = true; - } else if (DistanceX1 != DBL_MAX && DistanceY1 != DBL_MAX) - { - wxGraphicsContext *gr = wxGraphicsContext::Create(*dynDc); - DrawDistanceMarker(gr, DistanceX1, DistanceY1); - delete gr; - } else if (DistancePath != NULL) + if (DistancePath != NULL) { double x1; double y1; double x2; double y2; @@ -1441,10 +1404,31 @@ ln = ln->Next; } DrawDistanceMarker(gr, x1, y1); DrawDistanceMarker(gr, x2, y2); delete gr; + } else if (DistanceX2 != DBL_MAX && DistanceY2 != DBL_MAX + && DistanceX1 != DBL_MAX && DistanceY1 != DBL_MAX) + { + if (MainFrame->IsGeographic() == true) + ComputeGreatCircleArc(); + else + ComputePlanarDistance(); + wxGraphicsContext *gr = wxGraphicsContext::Create(*dynDc); + DrawDistancePath(gr); + DrawDistanceMarker(gr, DistanceX1, DistanceY1); + DrawDistanceMarker(gr, DistanceX2, DistanceY2); + delete gr; + DistanceX2 = DBL_MAX; + DistanceY2 = DBL_MAX; + DistanceX1 = DBL_MAX; + DistanceY1 = DBL_MAX; + } else if (DistanceX1 != DBL_MAX && DistanceY1 != DBL_MAX) + { + wxGraphicsContext *gr = wxGraphicsContext::Create(*dynDc); + DrawDistanceMarker(gr, DistanceX1, DistanceY1); + delete gr; } else { if (DistancePath != NULL) gaiaFreeGeomColl(DistancePath); DistancePath = NULL; @@ -1452,36 +1436,10 @@ wxMemoryDC *screenDc = new wxMemoryDC(ScreenBitmap); screenDc->Blit(0, 0, BitmapWidth, BitmapHeight, dynDc, 0, 0); delete dynDc; delete screenDc; Refresh(); - if (showDistance == true) - { - // measured distance message - if (MainFrame->IsGeographic() == true) - { - wxString msg = - wxT("Great Circle Distance: [assuming a spherical World]\n"); - char buf[128]; - sprintf(buf, "%1.2f Km\n\n", great_circle); - msg += wxString::FromUTF8(buf); - msg += - wxT("Geodesic Distance: [exactly measured on the Ellipsoid]\n"); - sprintf(buf, "%1.2f Km\n", geodesic); - msg += wxString::FromUTF8(buf); - wxMessageBox(msg, wxT("Measured Distance"), wxOK | wxICON_INFORMATION, - this); - } else - { - wxString msg = wxT("Planar Distance:\n"); - char buf[128]; - sprintf(buf, "%1.2f Km\n\n", length); - msg += wxString::FromUTF8(buf); - wxMessageBox(msg, wxT("Measured Distance"), wxOK | wxICON_INFORMATION, - this); - } - } } bool MyMapView::Graticules5Degrees() { // testing if 5 degrees graticules are currently visible @@ -2119,15 +2077,13 @@ } sqlite3_finalize(stmt); return ok; } -void MyMapView::ComputeGreatCircleArc(double *great_circle, double *geodesic) +void MyMapView::ComputeGreatCircleArc() { // computing a Great Circle Arc - *great_circle = 0.0; - *geodesic = 0.0; if (DistancePath != NULL) { gaiaFreeGeomColl(DistancePath); DistancePath = NULL; } @@ -2180,21 +2136,30 @@ gaiaSetPoint(ln->Coords, iv, pt->GetX(), pt->GetY()); iv++; } } - if (ComputeGreatCircleLength(great_circle, geodesic) != true) + double great_circle; + double geodesic; + if (ComputeGreatCircleLength(&great_circle, &geodesic) == true) { - *great_circle = 0.0; - *geodesic = 0.0; + wxString msg = + wxT("Great Circle Distance: [assuming a spherical Earth]\n"); + char buf[128]; + sprintf(buf, "%1.2f Km\n\n", great_circle); + msg += wxString::FromUTF8(buf); + msg += wxT("Geodesic Distance: [exactly measured on the Ellipsoid]\n"); + sprintf(buf, "%1.2f Km\n", geodesic); + msg += wxString::FromUTF8(buf); + wxMessageBox(msg, wxT("Measured Distance"), wxOK | wxICON_INFORMATION, + this); } } -void MyMapView::ComputePlanarDistance(double *length) +void MyMapView::ComputePlanarDistance() { // computing a planar distance - *length = 0.0; if (DistancePath != NULL) { gaiaFreeGeomColl(DistancePath); DistancePath = NULL; } @@ -2206,12 +2171,20 @@ DistancePath = gaiaAllocGeomColl(); gaiaLinestringPtr ln = gaiaAddLinestringToGeomColl(DistancePath, 2); gaiaSetPoint(ln->Coords, 0, DistanceX1, DistanceY1); gaiaSetPoint(ln->Coords, 1, DistanceX2, DistanceY2); - if (ComputePlanarLength(length) != true) - *length = 0.0; + double length; + if (ComputePlanarLength(&length) == true) + { + wxString msg = wxT("Planar Distance:\n"); + char buf[128]; + sprintf(buf, "%1.2f Km\n\n", length); + msg += wxString::FromUTF8(buf); + wxMessageBox(msg, wxT("Measured Distance"), wxOK | wxICON_INFORMATION, + this); + } } void MyMapView::DrawDistancePath(wxGraphicsContext * gr) { // drawing the Distance Path @@ -2218,11 +2191,11 @@ gaiaLinestringPtr line; if (DistancePath == NULL) return; - gr->SetPen(wxPen(wxColour(255, 255, 0), 8)); + gr->SetPen(wxPen(wxColour(255, 0, 0), 8)); line = DistancePath->FirstLinestring; while (line) { // marking a Linestring int iv; Index: config.h ================================================================== --- config.h +++ config.h @@ -139,20 +139,20 @@ /* Define to the full name of this package. */ #define PACKAGE_NAME "LibreAtlas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "LibreAtlas 1.0.0a" +#define PACKAGE_STRING "LibreAtlas 1.0.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libreatlas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.0.0a" +#define PACKAGE_VERSION "1.0.0" /* must be defined when using libspatialite-amalgamation */ /* #undef SPATIALITE_AMALGAMATION */ /* Define to 1 if you have the ANSI C header files. */ @@ -163,11 +163,11 @@ /* Define to 1 if your declares `struct tm'. */ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ -#define VERSION "1.0.0a" +#define VERSION "1.0.0" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `long int' if does not define. */ Index: configure ================================================================== --- configure +++ configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for LibreAtlas 1.0.0a. +# Generated by GNU Autoconf 2.68 for LibreAtlas 1.0.0. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -568,12 +568,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='LibreAtlas' PACKAGE_TARNAME='libreatlas' -PACKAGE_VERSION='1.0.0a' -PACKAGE_STRING='LibreAtlas 1.0.0a' +PACKAGE_VERSION='1.0.0' +PACKAGE_STRING='LibreAtlas 1.0.0' PACKAGE_BUGREPORT='a.furieri@lqt.it' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ @@ -1329,11 +1329,11 @@ # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LibreAtlas 1.0.0a to adapt to many kinds of systems. +\`configure' configures LibreAtlas 1.0.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -1399,11 +1399,11 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LibreAtlas 1.0.0a:";; + short | recursive ) echo "Configuration of LibreAtlas 1.0.0:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options @@ -1526,11 +1526,11 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LibreAtlas configure 1.0.0a +LibreAtlas configure 1.0.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -2070,11 +2070,11 @@ } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LibreAtlas $as_me 1.0.0a, which was +It was created by LibreAtlas $as_me 1.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF @@ -2893,11 +2893,11 @@ fi # Define the identity of the package. PACKAGE='libreatlas' - VERSION='1.0.0a' + VERSION='1.0.0' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF @@ -17543,11 +17543,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LibreAtlas $as_me 1.0.0a, which was +This file was extended by LibreAtlas $as_me 1.0.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17609,11 +17609,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -LibreAtlas config.status 1.0.0a +LibreAtlas config.status 1.0.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,10 +1,10 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) -AC_INIT(LibreAtlas, 1.0.0a, a.furieri@lqt.it) +AC_INIT(LibreAtlas, 1.0.0, a.furieri@lqt.it) AC_LANG(C) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE