mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-24 07:34:22 +02:00
Compare commits
24 Commits
13.14
...
436cf0d14c
Author | SHA1 | Date | |
---|---|---|---|
436cf0d14c | |||
0e83bd89d1 | |||
536d12469a | |||
c9f44506e7 | |||
bc4bffdfe7 | |||
eda35b6762 | |||
b05e7b15fe | |||
ed2fc0c627 | |||
60f58592b2 | |||
80abb6f604 | |||
19c4aa1c34 | |||
578045108f | |||
796c2e7eaf | |||
c08d3b7159 | |||
7f7de87e99 | |||
9cacf1906e | |||
cedca8725b | |||
c493f8cf16 | |||
866b2c27ca | |||
07614a8f74 | |||
bc7d965a49 | |||
e383a35c65 | |||
6b4990a204 | |||
7a7a331b58 |
@ -1,4 +1,4 @@
|
|||||||
version: 13.14.{build}
|
version: 13.15.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
@ -11,11 +11,10 @@ environment:
|
|||||||
matrix:
|
matrix:
|
||||||
- QTDIR: C:\Qt\5.15\msvc2019_64
|
- QTDIR: C:\Qt\5.15\msvc2019_64
|
||||||
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
|
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
|
||||||
OPENSSLVERSION: 1_1
|
NSISDEF: /DOPENSSL /DANGLE
|
||||||
- QTDIR: C:\Qt\6.5\msvc2019_64
|
- QTDIR: C:\Qt\6.5\msvc2019_64
|
||||||
OPENSSLDIR: C:\OpenSSL-v30-Win64\bin
|
OPENSSLDIR: C:\OpenSSL-v30-Win64\bin
|
||||||
OPENSSLVERSION: 3
|
NSISDEF: /DQT6 /DOPENSSL
|
||||||
NSISDEF: /DQT6
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- cmd: |-
|
- cmd: |-
|
||||||
@ -37,8 +36,8 @@ build_script:
|
|||||||
xcopy lang\*.qm installer\translations\ /sy
|
xcopy lang\*.qm installer\translations\ /sy
|
||||||
xcopy icons\symbols installer\symbols /i
|
xcopy icons\symbols installer\symbols /i
|
||||||
copy licence.txt installer
|
copy licence.txt installer
|
||||||
copy %OPENSSLDIR%\libcrypto-%OPENSSLVERSION%-x64.dll installer
|
copy %OPENSSLDIR%\libcrypto-*-x64.dll installer
|
||||||
copy %OPENSSLDIR%\libssl-%OPENSSLVERSION%-x64.dll installer
|
copy %OPENSSLDIR%\libssl-*-x64.dll installer
|
||||||
|
|
||||||
makensis.exe %NSISDEF% installer\gpxsee64.nsi
|
makensis.exe %NSISDEF% installer\gpxsee64.nsi
|
||||||
|
|
||||||
|
12
.github/workflows/android.yml
vendored
12
.github/workflows/android.yml
vendored
@ -15,14 +15,14 @@ jobs:
|
|||||||
- name: set up JDK 11
|
- name: set up JDK 11
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'temurin'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v2
|
uses: android-actions/setup-android@v3
|
||||||
- name: Run sdkmanager update
|
with:
|
||||||
run: ${ANDROID_HOME}/tools/bin/sdkmanager --update
|
cmdline-tools-version: 9862592
|
||||||
- name: Install android platform, platform-tools, build-tools and ndk
|
- name: Install android platform, build-tools and ndk
|
||||||
run: ${ANDROID_HOME}/tools/bin/sdkmanager --install "cmdline-tools;latest" "platform-tools" "platforms;android-33" "build-tools;33.0.0" "ndk;23.1.7779620"
|
run: ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-33" "build-tools;33.0.0" "ndk;23.1.7779620"
|
||||||
- name: Setup NDK path
|
- name: Setup NDK path
|
||||||
run: echo "ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk/23.1.7779620/" >> $GITHUB_ENV
|
run: echo "ANDROID_NDK_ROOT=${ANDROID_HOME}/ndk/23.1.7779620/" >> $GITHUB_ENV
|
||||||
- name: Install Qt (Desktop)
|
- name: Install Qt (Desktop)
|
||||||
|
4
.github/workflows/osx.yml
vendored
4
.github/workflows/osx.yml
vendored
@ -39,8 +39,8 @@ jobs:
|
|||||||
- name: Install Qt
|
- name: Install Qt
|
||||||
uses: jurplel/install-qt-action@v3
|
uses: jurplel/install-qt-action@v3
|
||||||
with:
|
with:
|
||||||
version: '6.5.1'
|
version: '6.6.1'
|
||||||
modules: qtpositioning qt5compat qtserialport
|
modules: qtpositioning qtserialport
|
||||||
- name: Create localization
|
- name: Create localization
|
||||||
run: lrelease gpxsee.pro
|
run: lrelease gpxsee.pro
|
||||||
- name: Configure build
|
- name: Configure build
|
||||||
|
11
gpxsee.pro
11
gpxsee.pro
@ -3,7 +3,7 @@ unix:!macx:!android {
|
|||||||
} else {
|
} else {
|
||||||
TARGET = GPXSee
|
TARGET = GPXSee
|
||||||
}
|
}
|
||||||
VERSION = 13.14
|
VERSION = 13.15
|
||||||
|
|
||||||
|
|
||||||
QT += core \
|
QT += core \
|
||||||
@ -18,8 +18,10 @@ QT += core \
|
|||||||
svg \
|
svg \
|
||||||
serialport
|
serialport
|
||||||
greaterThan(QT_MAJOR_VERSION, 5) {
|
greaterThan(QT_MAJOR_VERSION, 5) {
|
||||||
QT += openglwidgets \
|
QT += openglwidgets
|
||||||
core5compat
|
lessThan(QT_MINOR_VERSION, 5) {
|
||||||
|
QT += core5compat
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG += object_parallel_to_source
|
CONFIG += object_parallel_to_source
|
||||||
@ -510,10 +512,11 @@ macx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
win32 {
|
win32 {
|
||||||
|
CONFIG += no_batch
|
||||||
RESOURCES += theme-color.qrc
|
RESOURCES += theme-color.qrc
|
||||||
|
|
||||||
QMAKE_TARGET_DESCRIPTION = GPXSee
|
QMAKE_TARGET_DESCRIPTION = GPXSee
|
||||||
QMAKE_TARGET_COPYRIGHT = Copyright (c) 2023 Martin Tuma
|
QMAKE_TARGET_COPYRIGHT = Copyright (c) 2015-2024 Martin Tuma
|
||||||
RC_ICONS = icons/app/gpxsee.ico \
|
RC_ICONS = icons/app/gpxsee.ico \
|
||||||
icons/formats/gpx.ico \
|
icons/formats/gpx.ico \
|
||||||
icons/formats/tcx.ico \
|
icons/formats/tcx.ico \
|
||||||
|
@ -37,7 +37,7 @@ Unicode true
|
|||||||
; The name of the installer
|
; The name of the installer
|
||||||
Name "GPXSee"
|
Name "GPXSee"
|
||||||
; Program version
|
; Program version
|
||||||
!define VERSION "13.14"
|
!define VERSION "13.15"
|
||||||
|
|
||||||
; The file to write
|
; The file to write
|
||||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||||
@ -58,7 +58,7 @@ VIProductVersion "${VERSION}.0.0"
|
|||||||
VIAddVersionKey "ProductVersion" ${VERSION}
|
VIAddVersionKey "ProductVersion" ${VERSION}
|
||||||
VIAddVersionKey "FileVersion" "${VERSION}.0.0"
|
VIAddVersionKey "FileVersion" "${VERSION}.0.0"
|
||||||
VIAddVersionKey "ProductName" "GPXSee"
|
VIAddVersionKey "ProductName" "GPXSee"
|
||||||
VIAddVersionKey "LegalCopyright" "Copyright (c) 2023 Martin Tůma"
|
VIAddVersionKey "LegalCopyright" "Copyright (c) 2015-2024 Martin Tůma"
|
||||||
VIAddVersionKey "FileDescription" "GPXSee installer (x64)"
|
VIAddVersionKey "FileDescription" "GPXSee installer (x64)"
|
||||||
|
|
||||||
; Registry key to check for directory (so if you install again, it will
|
; Registry key to check for directory (so if you install again, it will
|
||||||
@ -95,10 +95,17 @@ Var StartMenuFolder
|
|||||||
!insertmacro MUI_LANGUAGE "English"
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
Function .onInit
|
Function .onInit
|
||||||
|
!ifdef QT6
|
||||||
|
${IfNot} ${AtLeastWin10}
|
||||||
|
MessageBox MB_OK "GPXSee can only be installed on Windows 10 or later."
|
||||||
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
!else
|
||||||
${IfNot} ${AtLeastWin7}
|
${IfNot} ${AtLeastWin7}
|
||||||
MessageBox MB_OK "GPXSee can only be installed on Windows 7 or later."
|
MessageBox MB_OK "GPXSee can only be installed on Windows 7 or later."
|
||||||
Abort
|
Abort
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
!endif
|
||||||
|
|
||||||
${If} ${RunningX64}
|
${If} ${RunningX64}
|
||||||
SetRegView 64
|
SetRegView 64
|
||||||
@ -249,7 +256,7 @@ Section "GPXSee" SEC_APP
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
Section "QT framework" SEC_QT
|
Section "Qt framework" SEC_QT
|
||||||
|
|
||||||
SectionIn RO
|
SectionIn RO
|
||||||
|
|
||||||
@ -264,7 +271,6 @@ Section "QT framework" SEC_QT
|
|||||||
File "Qt6Sql.dll"
|
File "Qt6Sql.dll"
|
||||||
File "Qt6Svg.dll"
|
File "Qt6Svg.dll"
|
||||||
File "Qt6Widgets.dll"
|
File "Qt6Widgets.dll"
|
||||||
File "Qt6Core5Compat.dll"
|
|
||||||
File "Qt6Positioning.dll"
|
File "Qt6Positioning.dll"
|
||||||
File "Qt6SerialPort.dll"
|
File "Qt6SerialPort.dll"
|
||||||
File /r "tls"
|
File /r "tls"
|
||||||
@ -282,6 +288,7 @@ Section "QT framework" SEC_QT
|
|||||||
File /r "printsupport"
|
File /r "printsupport"
|
||||||
!endif
|
!endif
|
||||||
File /r "platforms"
|
File /r "platforms"
|
||||||
|
File /r "iconengines"
|
||||||
File /r "imageformats"
|
File /r "imageformats"
|
||||||
File /r "styles"
|
File /r "styles"
|
||||||
File /r "sqldrivers"
|
File /r "sqldrivers"
|
||||||
@ -300,21 +307,30 @@ Section "MSVC runtime" SEC_MSVC
|
|||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
!ifdef ICU
|
||||||
|
Section "ICU" SEC_ICU
|
||||||
|
|
||||||
|
SectionIn RO
|
||||||
|
|
||||||
|
File "icudt*.dll"
|
||||||
|
File "icuin*.dll"
|
||||||
|
File "icuuc*.dll"
|
||||||
|
|
||||||
|
SectionEnd
|
||||||
|
!endif
|
||||||
|
|
||||||
|
!ifdef OPENSSL
|
||||||
Section "OpenSSL" SEC_OPENSSL
|
Section "OpenSSL" SEC_OPENSSL
|
||||||
|
|
||||||
SectionIn RO
|
SectionIn RO
|
||||||
|
|
||||||
!ifdef QT6
|
File "libcrypto-*-x64.dll"
|
||||||
File "libcrypto-3-x64.dll"
|
File "libssl-*-x64.dll"
|
||||||
File "libssl-3-x64.dll"
|
|
||||||
!else
|
|
||||||
File "libcrypto-1_1-x64.dll"
|
|
||||||
File "libssl-1_1-x64.dll"
|
|
||||||
!endif
|
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
!endif
|
||||||
|
|
||||||
!ifndef QT6
|
!ifdef ANGLE
|
||||||
Section "ANGLE" SEC_ANGLE
|
Section "ANGLE" SEC_ANGLE
|
||||||
|
|
||||||
File "libGLESv2.dll"
|
File "libGLESv2.dll"
|
||||||
@ -470,13 +486,24 @@ SectionEnd
|
|||||||
; Descriptions
|
; Descriptions
|
||||||
|
|
||||||
; Language strings
|
; Language strings
|
||||||
|
!ifdef QT6
|
||||||
LangString DESC_QT ${LANG_ENGLISH} \
|
LangString DESC_QT ${LANG_ENGLISH} \
|
||||||
"QT cross-platform application framework."
|
"Qt6 cross-platform application framework."
|
||||||
|
!else
|
||||||
|
LangString DESC_QT ${LANG_ENGLISH} \
|
||||||
|
"Qt5 cross-platform application framework."
|
||||||
|
!endif
|
||||||
LangString DESC_MSVC ${LANG_ENGLISH} \
|
LangString DESC_MSVC ${LANG_ENGLISH} \
|
||||||
"Microsoft Visual C++ 2019 runtime. If already installed, will be skipped."
|
"Microsoft Visual C++ runtime. If already installed, will be skipped."
|
||||||
|
!ifdef ICU
|
||||||
|
LangString DESC_ICU ${LANG_ENGLISH} \
|
||||||
|
"ICU library. Required for character set/encoding conversions."
|
||||||
|
!endif
|
||||||
|
!ifdef OPENSSL
|
||||||
LangString DESC_OPENSSL ${LANG_ENGLISH} \
|
LangString DESC_OPENSSL ${LANG_ENGLISH} \
|
||||||
"OpenSSL library. Required for HTTPS to work."
|
"OpenSSL library. Qt SSL/TLS backend for HTTPS."
|
||||||
!ifndef QT6
|
!endif
|
||||||
|
!ifdef ANGLE
|
||||||
LangString DESC_ANGLE ${LANG_ENGLISH} \
|
LangString DESC_ANGLE ${LANG_ENGLISH} \
|
||||||
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
"ANGLE (OpenGL via Direct3D). Enables OpenGL on systems without native OpenGL drivers."
|
||||||
!endif
|
!endif
|
||||||
@ -488,8 +515,13 @@ LangString DESC_LOCALIZATION ${LANG_ENGLISH} \
|
|||||||
; Assign language strings to sections
|
; Assign language strings to sections
|
||||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QT} $(DESC_QT)
|
||||||
|
!ifdef ICU
|
||||||
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ICU} $(DESC_ICU)
|
||||||
|
!endif
|
||||||
|
!ifdef OPENSSL
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_OPENSSL} $(DESC_OPENSSL)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_OPENSSL} $(DESC_OPENSSL)
|
||||||
!ifndef QT6
|
!endif
|
||||||
|
!ifdef ANGLE
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||||
!endif
|
!endif
|
||||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
#include <QFont>
|
||||||
#include "common/range.h"
|
#include "common/range.h"
|
||||||
|
|
||||||
class AxisItem : public QGraphicsItem
|
class AxisItem : public QGraphicsItem
|
||||||
|
@ -1028,13 +1028,16 @@ void GUI::openDir()
|
|||||||
|
|
||||||
bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
|
bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
|
||||||
{
|
{
|
||||||
if (_files.contains(fileName))
|
QFileInfo fi(fileName);
|
||||||
|
QString canonicalFileName(fi.canonicalFilePath());
|
||||||
|
|
||||||
|
if (_files.contains(canonicalFileName))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!loadFile(fileName, tryUnknown, showError))
|
if (!loadFile(fileName, tryUnknown, showError))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_files.append(fileName);
|
_files.append(canonicalFileName);
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
_browser->setCurrent(fileName);
|
_browser->setCurrent(fileName);
|
||||||
#endif // Q_OS_ANDROID
|
#endif // Q_OS_ANDROID
|
||||||
@ -1047,7 +1050,7 @@ bool GUI::openFile(const QString &fileName, bool tryUnknown, int &showError)
|
|||||||
updateStatusBarInfo();
|
updateStatusBarInfo();
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
#ifndef Q_OS_ANDROID
|
#ifndef Q_OS_ANDROID
|
||||||
updateRecentFiles(fileName);
|
updateRecentFiles(canonicalFileName);
|
||||||
#endif // Q_OS_ANDROID
|
#endif // Q_OS_ANDROID
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QFont>
|
||||||
#include "common/kv.h"
|
#include "common/kv.h"
|
||||||
|
|
||||||
class InfoItem : public QGraphicsItem
|
class InfoItem : public QGraphicsItem
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define MOTIONINFOITEM_H
|
#define MOTIONINFOITEM_H
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include <QFont>
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
|
|
||||||
class MotionInfoItem : public QGraphicsItem
|
class MotionInfoItem : public QGraphicsItem
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include <QtMath>
|
||||||
#include "graphicsscene.h"
|
#include "graphicsscene.h"
|
||||||
|
|
||||||
class PathTickItem : public GraphicsItem
|
class PathTickItem : public GraphicsItem
|
||||||
@ -16,7 +17,7 @@ public:
|
|||||||
|
|
||||||
void setPos(const QPointF &pos);
|
void setPos(const QPointF &pos);
|
||||||
void setColor(const QColor &color) {_brush = QBrush(color);}
|
void setColor(const QColor &color) {_brush = QBrush(color);}
|
||||||
void setDigitalZoom(int zoom) {setScale(pow(2, -zoom));}
|
void setDigitalZoom(int zoom) {setScale(qPow(2, -zoom));}
|
||||||
|
|
||||||
int type() const {return parentItem()->type();}
|
int type() const {return parentItem()->type();}
|
||||||
ToolTip info() const
|
ToolTip info() const
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QFormLayout>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
@ -93,21 +94,29 @@ void PopupFrame::createLayout(const ToolTip &content)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!content.list().isEmpty()) {
|
if (!content.list().isEmpty()) {
|
||||||
QString html = "<table>";
|
QFormLayout *textLayout = new QFormLayout();
|
||||||
for (int i = 0; i < content.list().count(); i++)
|
textLayout->setLabelAlignment(Qt::AlignRight);
|
||||||
html += "<tr><td align=\"right\"><b>" + content.list().at(i).key()
|
textLayout->setHorizontalSpacing(5);
|
||||||
+ ": </b></td><td>" + content.list().at(i).value()
|
textLayout->setVerticalSpacing(2);
|
||||||
+ "</td></tr>";
|
|
||||||
html += "</table>";
|
|
||||||
|
|
||||||
QLabel *label = new QLabel(html);
|
for (int i = 0; i < content.list().count(); i++) {
|
||||||
label->setAlignment(Qt::AlignLeft);
|
QLabel *key = new QLabel(content.list().at(i).key() + ":");
|
||||||
label->setIndent(1);
|
key->setTextFormat(Qt::PlainText);
|
||||||
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
key->setAlignment(Qt::AlignTop);
|
||||||
label->setOpenExternalLinks(true);
|
key->setStyleSheet("font-weight: bold");
|
||||||
label->setWordWrap(true);
|
QLabel *value = new QLabel(content.list().at(i).value());
|
||||||
|
value->setSizePolicy(QSizePolicy::MinimumExpanding,
|
||||||
|
QSizePolicy::Preferred);
|
||||||
|
value->setTextFormat(Qt::RichText);
|
||||||
|
value->setAlignment(Qt::AlignTop);
|
||||||
|
value->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
value->setOpenExternalLinks(true);
|
||||||
|
value->setWordWrap(true);
|
||||||
|
|
||||||
layout->addWidget(label);
|
textLayout->addRow(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
layout->addLayout(textLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define SCALEITEM_H
|
#define SCALEITEM_H
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include <QFont>
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
|
|
||||||
class ScaleItem : public QGraphicsItem
|
class ScaleItem : public QGraphicsItem
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define SLIDERINFOITEM_H
|
#define SLIDERINFOITEM_H
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
class SliderInfoItem : public QGraphicsItem
|
class SliderInfoItem : public QGraphicsItem
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
#define HASH_H
|
#define HASH_H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QPoint>
|
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
#include <QPoint>
|
||||||
|
#include <QPair>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
#define HASH_T uint
|
#define HASH_T uint
|
||||||
|
|
||||||
inline uint qHash(const QPoint &p)
|
inline uint qHash(const QPoint &p)
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
#include <QTextCodec>
|
|
||||||
#include "textcodec.h"
|
#include "textcodec.h"
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
|
||||||
static QTextCodec *codec(int mib)
|
static QTextCodec *codec(int mib)
|
||||||
{
|
{
|
||||||
QTextCodec *c = QTextCodec::codecForMib(mib);
|
QTextCodec *c = QTextCodec::codecForMib(mib);
|
||||||
if (!c)
|
if (!c)
|
||||||
qWarning("MIB-%d: No such QTextCodec, using UTF-8", mib);
|
qWarning("MIB-%d: No such QTextCodec, using ISO-8859-1", mib);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextCodec::TextCodec() : _codec(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
TextCodec::TextCodec(int codepage)
|
TextCodec::TextCodec(int codepage)
|
||||||
{
|
{
|
||||||
switch (codepage) {
|
switch (codepage) {
|
||||||
@ -56,15 +61,40 @@ TextCodec::TextCodec(int codepage)
|
|||||||
_codec = codec(2258);
|
_codec = codec(2258);
|
||||||
break;
|
break;
|
||||||
case 65001:
|
case 65001:
|
||||||
_codec = 0;
|
_codec = codec(106);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning("%d: Unknown codepage, using UTF-8", codepage);
|
qWarning("%d: Unknown codepage, using ISO-8859-1", codepage);
|
||||||
_codec = 0;
|
_codec = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TextCodec::toString(const QByteArray &ba) const
|
QString TextCodec::toString(const QByteArray &ba)
|
||||||
{
|
{
|
||||||
return _codec ? _codec->toUnicode(ba) : QString::fromUtf8(ba);
|
return _codec ? _codec->toUnicode(ba) : QString::fromLatin1(ba);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // QT 6.5
|
||||||
|
|
||||||
|
TextCodec::TextCodec()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TextCodec::TextCodec(int codepage)
|
||||||
|
{
|
||||||
|
if (codepage == 65001)
|
||||||
|
_decoder = QStringDecoder(QStringDecoder::Utf8);
|
||||||
|
else {
|
||||||
|
QByteArray cp(QByteArray("CP") + QByteArray::number(codepage));
|
||||||
|
_decoder = QStringDecoder(cp.constData());
|
||||||
|
|
||||||
|
if (!_decoder.isValid())
|
||||||
|
qWarning("%d: Unknown codepage, using ISO-8859-1", codepage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString TextCodec::toString(const QByteArray &ba)
|
||||||
|
{
|
||||||
|
return _decoder.isValid() ? _decoder.decode(ba) : QString::fromLatin1(ba);
|
||||||
|
}
|
||||||
|
#endif // QT 6.5
|
||||||
|
@ -2,20 +2,26 @@
|
|||||||
#define TEXTCODEC_H
|
#define TEXTCODEC_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMap>
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
|
#include <QTextCodec>
|
||||||
class QTextCodec;
|
#else // QT 6.5
|
||||||
|
#include <QStringDecoder>
|
||||||
|
#endif // QT 6.5
|
||||||
|
|
||||||
class TextCodec
|
class TextCodec
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextCodec() : _codec(0) {}
|
TextCodec();
|
||||||
TextCodec(int codepage);
|
TextCodec(int codepage);
|
||||||
|
|
||||||
QString toString(const QByteArray &ba) const;
|
QString toString(const QByteArray &ba);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
|
||||||
QTextCodec *_codec;
|
QTextCodec *_codec;
|
||||||
|
#else // QT 6.5
|
||||||
|
QStringDecoder _decoder;
|
||||||
|
#endif // QT 6.5
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TEXTCODEC_H
|
#endif // TEXTCODEC_H
|
||||||
|
@ -128,7 +128,7 @@ qint64 CryptDevice::readData(char *data, qint64 maxSize)
|
|||||||
class DataStream : public QDataStream
|
class DataStream : public QDataStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DataStream(QIODevice *d) : QDataStream(d), _codec(1252) {}
|
DataStream(QIODevice *d) : QDataStream(d) {}
|
||||||
|
|
||||||
void setCodepage(quint16 codepage) {_codec = TextCodec(codepage);}
|
void setCodepage(quint16 codepage) {_codec = TextCodec(codepage);}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ void LBLFile::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label LBLFile::str2label(const QVector<quint8> &str, bool capitalize,
|
Label LBLFile::str2label(const QVector<quint8> &str, bool capitalize,
|
||||||
bool convert) const
|
bool convert)
|
||||||
{
|
{
|
||||||
Shield::Type shieldType = Shield::None;
|
Shield::Type shieldType = Shield::None;
|
||||||
QByteArray label, shieldLabel;
|
QByteArray label, shieldLabel;
|
||||||
@ -247,7 +247,7 @@ Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label LBLFile::label8b(const SubFile *file, Handle &fileHdl, quint32 size,
|
Label LBLFile::label8b(const SubFile *file, Handle &fileHdl, quint32 size,
|
||||||
bool capitalize, bool convert) const
|
bool capitalize, bool convert)
|
||||||
{
|
{
|
||||||
QVector<quint8> str;
|
QVector<quint8> str;
|
||||||
quint8 c;
|
quint8 c;
|
||||||
@ -264,7 +264,7 @@ Label LBLFile::label8b(const SubFile *file, Handle &fileHdl, quint32 size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label LBLFile::labelHuffman(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
Label LBLFile::labelHuffman(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
||||||
quint32 size, bool capitalize, bool convert) const
|
quint32 size, bool capitalize, bool convert)
|
||||||
{
|
{
|
||||||
QVector<quint8> str;
|
QVector<quint8> str;
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ Label LBLFile::labelHuffman(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label LBLFile::label(Handle &hdl, quint32 offset, bool poi, bool capitalize,
|
Label LBLFile::label(Handle &hdl, quint32 offset, bool poi, bool capitalize,
|
||||||
bool convert) const
|
bool convert)
|
||||||
{
|
{
|
||||||
quint32 labelOffset;
|
quint32 labelOffset;
|
||||||
if (poi) {
|
if (poi) {
|
||||||
@ -328,7 +328,7 @@ Label LBLFile::label(Handle &hdl, quint32 offset, bool poi, bool capitalize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label LBLFile::label(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
Label LBLFile::label(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
||||||
quint32 size, bool capitalize, bool convert) const
|
quint32 size, bool capitalize, bool convert)
|
||||||
{
|
{
|
||||||
switch (_encoding) {
|
switch (_encoding) {
|
||||||
case 6:
|
case 6:
|
||||||
|
@ -30,9 +30,9 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
Label label(Handle &hdl, quint32 offset, bool poi = false,
|
Label label(Handle &hdl, quint32 offset, bool poi = false,
|
||||||
bool capitalize = true, bool convert = false) const;
|
bool capitalize = true, bool convert = false);
|
||||||
Label label(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
Label label(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
||||||
quint32 size, bool capitalize = true, bool convert = false) const;
|
quint32 size, bool capitalize = true, bool convert = false);
|
||||||
|
|
||||||
quint8 imageIdSize() const {return _imgIdSize;}
|
quint8 imageIdSize() const {return _imgIdSize;}
|
||||||
QPixmap image(Handle &hdl, quint32 id) const;
|
QPixmap image(Handle &hdl, quint32 id) const;
|
||||||
@ -44,13 +44,13 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Label str2label(const QVector<quint8> &str, bool capitalize,
|
Label str2label(const QVector<quint8> &str, bool capitalize,
|
||||||
bool convert) const;
|
bool convert);
|
||||||
Label label6b(const SubFile *file, Handle &fileHdl, quint32 size,
|
Label label6b(const SubFile *file, Handle &fileHdl, quint32 size,
|
||||||
bool capitalize, bool convert) const;
|
bool capitalize, bool convert) const;
|
||||||
Label label8b(const SubFile *file, Handle &fileHdl, quint32 size,
|
Label label8b(const SubFile *file, Handle &fileHdl, quint32 size,
|
||||||
bool capitalize, bool convert) const;
|
bool capitalize, bool convert);
|
||||||
Label labelHuffman(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
Label labelHuffman(Handle &hdl, const SubFile *file, Handle &fileHdl,
|
||||||
quint32 size, bool capitalize, bool convert) const;
|
quint32 size, bool capitalize, bool convert);
|
||||||
bool loadRasterTable(Handle &hdl, quint32 offset, quint32 size,
|
bool loadRasterTable(Handle &hdl, quint32 offset, quint32 size,
|
||||||
quint32 recordSize);
|
quint32 recordSize);
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ bool NETFile::readShape(const NODFile *nod, SubFile::Handle &nodHdl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NETFile::linkLabel(Handle &hdl, quint32 offset,
|
bool NETFile::linkLabel(Handle &hdl, quint32 offset,
|
||||||
const LBLFile *lbl, Handle &lblHdl, Label &label) const
|
LBLFile *lbl, Handle &lblHdl, Label &label) const
|
||||||
{
|
{
|
||||||
if (!seek(hdl, offset))
|
if (!seek(hdl, offset))
|
||||||
return false;
|
return false;
|
||||||
@ -392,7 +392,7 @@ NETFile::~NETFile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NETFile::link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
|
bool NETFile::link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
|
||||||
const NODFile *nod, Handle &nodHdl2, Handle &nodHdl, const LBLFile *lbl,
|
const NODFile *nod, Handle &nodHdl2, Handle &nodHdl, LBLFile *lbl,
|
||||||
Handle &lblHdl, const NODFile::BlockInfo &blockInfo, quint8 linkId,
|
Handle &lblHdl, const NODFile::BlockInfo &blockInfo, quint8 linkId,
|
||||||
quint8 lineId, QList<MapData::Poly> *lines) const
|
quint8 lineId, QList<MapData::Poly> *lines) const
|
||||||
{
|
{
|
||||||
|
@ -30,13 +30,13 @@ public:
|
|||||||
|
|
||||||
bool lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset) const;
|
bool lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset) const;
|
||||||
bool link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
|
bool link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
|
||||||
const NODFile *nod, Handle &nodHdl2, Handle &nodHdl, const LBLFile *lbl,
|
const NODFile *nod, Handle &nodHdl2, Handle &nodHdl, LBLFile *lbl,
|
||||||
Handle &lblHdl, const NODFile::BlockInfo &blockInfo, quint8 linkId,
|
Handle &lblHdl, const NODFile::BlockInfo &blockInfo, quint8 linkId,
|
||||||
quint8 lineId, QList<MapData::Poly> *lines) const;
|
quint8 lineId, QList<MapData::Poly> *lines) const;
|
||||||
bool hasLinks() const {return (_links.size > 0);}
|
bool hasLinks() const {return (_links.size > 0);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool linkLabel(Handle &hdl, quint32 offset, const LBLFile *lbl,
|
bool linkLabel(Handle &hdl, quint32 offset, LBLFile *lbl,
|
||||||
Handle &lblHdl, Label &label) const;
|
Handle &lblHdl, Label &label) const;
|
||||||
bool readShape(const NODFile *nod, SubFile::Handle &nodHdl,
|
bool readShape(const NODFile *nod, SubFile::Handle &nodHdl,
|
||||||
NODFile::AdjacencyInfo &adj, BitStream4R &bs, const SubDiv *subdiv,
|
NODFile::AdjacencyInfo &adj, BitStream4R &bs, const SubDiv *subdiv,
|
||||||
|
@ -107,7 +107,7 @@ bool RGNFile::readObstructionInfo(Handle &hdl, quint8 flags, quint32 size,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::readLabel(Handle &hdl, const LBLFile *lbl, Handle &lblHdl,
|
bool RGNFile::readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
|
||||||
quint8 flags, quint32 size, MapData::Point *point) const
|
quint8 flags, quint32 size, MapData::Point *point) const
|
||||||
{
|
{
|
||||||
if (!(flags & 1))
|
if (!(flags & 1))
|
||||||
@ -122,7 +122,7 @@ bool RGNFile::readLabel(Handle &hdl, const LBLFile *lbl, Handle &lblHdl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
|
bool RGNFile::readClassFields(Handle &hdl, SegmentType segmentType,
|
||||||
void *object, const LBLFile *lbl, Handle &lblHdl) const
|
void *object, LBLFile *lbl, Handle &lblHdl) const
|
||||||
{
|
{
|
||||||
quint8 flags;
|
quint8 flags;
|
||||||
quint32 rs = 0;
|
quint32 rs = 0;
|
||||||
@ -257,7 +257,7 @@ void RGNFile::clear()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::polyObjects(Handle &hdl, const SubDiv *subdiv,
|
bool RGNFile::polyObjects(Handle &hdl, const SubDiv *subdiv,
|
||||||
SegmentType segmentType, const LBLFile *lbl, Handle &lblHdl, NETFile *net,
|
SegmentType segmentType, LBLFile *lbl, Handle &lblHdl, NETFile *net,
|
||||||
Handle &netHdl, QList<MapData::Poly> *polys) const
|
Handle &netHdl, QList<MapData::Poly> *polys) const
|
||||||
{
|
{
|
||||||
const SubDiv::Segment &segment = (segmentType == Line)
|
const SubDiv::Segment &segment = (segmentType == Line)
|
||||||
@ -340,7 +340,7 @@ bool RGNFile::polyObjects(Handle &hdl, const SubDiv *subdiv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
bool RGNFile::extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
||||||
SegmentType segmentType, const LBLFile *lbl, Handle &lblHdl,
|
SegmentType segmentType, LBLFile *lbl, Handle &lblHdl,
|
||||||
QList<MapData::Poly> *polys) const
|
QList<MapData::Poly> *polys) const
|
||||||
{
|
{
|
||||||
quint32 labelPtr, len;
|
quint32 labelPtr, len;
|
||||||
@ -457,7 +457,7 @@ bool RGNFile::extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
|
bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
|
||||||
SegmentType segmentType, const LBLFile *lbl, Handle &lblHdl,
|
SegmentType segmentType, LBLFile *lbl, Handle &lblHdl,
|
||||||
QList<MapData::Point> *points) const
|
QList<MapData::Point> *points) const
|
||||||
{
|
{
|
||||||
const SubDiv::Segment &segment = (segmentType == IndexedPoint)
|
const SubDiv::Segment &segment = (segmentType == IndexedPoint)
|
||||||
@ -502,7 +502,7 @@ bool RGNFile::pointObjects(Handle &hdl, const SubDiv *subdiv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv,
|
bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv,
|
||||||
const LBLFile *lbl, Handle &lblHdl, QList<MapData::Point> *points) const
|
LBLFile *lbl, Handle &lblHdl, QList<MapData::Point> *points) const
|
||||||
{
|
{
|
||||||
const SubDiv::Segment &segment = subdiv->extPoints();
|
const SubDiv::Segment &segment = subdiv->extPoints();
|
||||||
|
|
||||||
@ -554,7 +554,7 @@ bool RGNFile::extPointObjects(Handle &hdl, const SubDiv *subdiv,
|
|||||||
|
|
||||||
bool RGNFile::links(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
bool RGNFile::links(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
||||||
const NETFile *net, Handle &netHdl, const NODFile *nod, Handle &nodHdl,
|
const NETFile *net, Handle &netHdl, const NODFile *nod, Handle &nodHdl,
|
||||||
Handle &nodHdl2, const LBLFile *lbl, Handle &lblHdl,
|
Handle &nodHdl2, LBLFile *lbl, Handle &lblHdl,
|
||||||
QList<MapData::Poly> *lines) const
|
QList<MapData::Poly> *lines) const
|
||||||
{
|
{
|
||||||
quint32 size, blockIndexId;
|
quint32 size, blockIndexId;
|
||||||
|
@ -33,18 +33,18 @@ public:
|
|||||||
bool load(Handle &hdl);
|
bool load(Handle &hdl);
|
||||||
|
|
||||||
bool polyObjects(Handle &hdl, const SubDiv *subdiv, SegmentType segmentType,
|
bool polyObjects(Handle &hdl, const SubDiv *subdiv, SegmentType segmentType,
|
||||||
const LBLFile *lbl, Handle &lblHdl, NETFile *net, Handle &netHdl,
|
LBLFile *lbl, Handle &lblHdl, NETFile *net, Handle &netHdl,
|
||||||
QList<MapData::Poly> *polys) const;
|
QList<MapData::Poly> *polys) const;
|
||||||
bool pointObjects(Handle &hdl, const SubDiv *subdiv, SegmentType segmentType,
|
bool pointObjects(Handle &hdl, const SubDiv *subdiv, SegmentType segmentType,
|
||||||
const LBLFile *lbl, Handle &lblHdl, QList<MapData::Point> *points) const;
|
LBLFile *lbl, Handle &lblHdl, QList<MapData::Point> *points) const;
|
||||||
bool extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
bool extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
||||||
SegmentType segmentType, const LBLFile *lbl, Handle &lblHdl,
|
SegmentType segmentType, LBLFile *lbl, Handle &lblHdl,
|
||||||
QList<MapData::Poly> *polys) const;
|
QList<MapData::Poly> *polys) const;
|
||||||
bool extPointObjects(Handle &hdl, const SubDiv *subdiv, const LBLFile *lbl,
|
bool extPointObjects(Handle &hdl, const SubDiv *subdiv, LBLFile *lbl,
|
||||||
Handle &lblHdl, QList<MapData::Point> *points) const;
|
Handle &lblHdl, QList<MapData::Point> *points) const;
|
||||||
bool links(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
bool links(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
||||||
const NETFile *net, Handle &netHdl, const NODFile *nod, Handle &nodHdl,
|
const NETFile *net, Handle &netHdl, const NODFile *nod, Handle &nodHdl,
|
||||||
Handle &nodHdl2, const LBLFile *lbl, Handle &lblHdl,
|
Handle &nodHdl2, LBLFile *lbl, Handle &lblHdl,
|
||||||
QList<MapData::Poly> *lines) const;
|
QList<MapData::Poly> *lines) const;
|
||||||
|
|
||||||
bool subdivInit(Handle &hdl, SubDiv *subdiv) const;
|
bool subdivInit(Handle &hdl, SubDiv *subdiv) const;
|
||||||
@ -55,7 +55,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool segments(Handle &hdl, SubDiv *subdiv, SubDiv::Segment seg[5]) const;
|
bool segments(Handle &hdl, SubDiv *subdiv, SubDiv::Segment seg[5]) const;
|
||||||
bool readClassFields(Handle &hdl, SegmentType segmentType, void *object,
|
bool readClassFields(Handle &hdl, SegmentType segmentType, void *object,
|
||||||
const LBLFile *lbl, Handle &lblHdl) const;
|
LBLFile *lbl, Handle &lblHdl) const;
|
||||||
bool skipLclFields(Handle &hdl, const quint32 flags[3]) const;
|
bool skipLclFields(Handle &hdl, const quint32 flags[3]) const;
|
||||||
bool skipGblFields(Handle &hdl, quint32 flags) const;
|
bool skipGblFields(Handle &hdl, quint32 flags) const;
|
||||||
bool readRasterInfo(Handle &hdl, const LBLFile *lbl, quint32 size,
|
bool readRasterInfo(Handle &hdl, const LBLFile *lbl, quint32 size,
|
||||||
@ -64,7 +64,7 @@ private:
|
|||||||
MapData::Point *point) const;
|
MapData::Point *point) const;
|
||||||
bool readObstructionInfo(Handle &hdl, quint8 flags, quint32 size,
|
bool readObstructionInfo(Handle &hdl, quint8 flags, quint32 size,
|
||||||
MapData::Point *point) const;
|
MapData::Point *point) const;
|
||||||
bool readLabel(Handle &hdl, const LBLFile *lbl, Handle &lblHdl,
|
bool readLabel(Handle &hdl, LBLFile *lbl, Handle &lblHdl,
|
||||||
quint8 flags, quint32 size, MapData::Point *point) const;
|
quint8 flags, quint32 size, MapData::Point *point) const;
|
||||||
|
|
||||||
HuffmanTable *_huffmanTable;
|
HuffmanTable *_huffmanTable;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define IMG_SHIELD_H
|
#define IMG_SHIELD_H
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QDebug>
|
||||||
#include "common/hash.h"
|
#include "common/hash.h"
|
||||||
|
|
||||||
#define FIRST_SHIELD Shield::USInterstate
|
#define FIRST_SHIELD Shield::USInterstate
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
class Ellipsoid
|
class Ellipsoid
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Ellipsoid() : _radius(NAN), _flattening(NAN), _es(NAN), _b(NAN) {}
|
Ellipsoid()
|
||||||
|
: _radius(NAN), _flattening(NAN), _es(NAN), _e2s(NAN), _b(NAN) {}
|
||||||
Ellipsoid(double radius, double flattening);
|
Ellipsoid(double radius, double flattening);
|
||||||
|
|
||||||
double radius() const {return _radius;}
|
double radius() const {return _radius;}
|
||||||
|
@ -24,11 +24,6 @@ bool GmiFile::parse(QIODevice &device)
|
|||||||
int width, height;
|
int width, height;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
if (!device.open(QIODevice::ReadOnly)) {
|
|
||||||
_errorString = device.errorString();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!device.atEnd()) {
|
while (!device.atEnd()) {
|
||||||
QByteArray line = device.readLine(4096);
|
QByteArray line = device.readLine(4096);
|
||||||
|
|
||||||
@ -42,13 +37,13 @@ bool GmiFile::parse(QIODevice &device)
|
|||||||
else if (ln == 3) {
|
else if (ln == 3) {
|
||||||
width = line.toInt(&ok);
|
width = line.toInt(&ok);
|
||||||
if (!ok || width <= 0) {
|
if (!ok || width <= 0) {
|
||||||
_errorString = "Invalid image width";
|
_errorString = line + ": invalid image width";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (ln == 4) {
|
} else if (ln == 4) {
|
||||||
height = line.toInt(&ok);
|
height = line.toInt(&ok);
|
||||||
if (!ok || height <= 0) {
|
if (!ok || height <= 0) {
|
||||||
_errorString = "Invalid image height";
|
_errorString = line + ": invalid image height";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_size = QSize(width, height);
|
_size = QSize(width, height);
|
||||||
@ -56,19 +51,34 @@ bool GmiFile::parse(QIODevice &device)
|
|||||||
CalibrationPoint cp(calibrationPoint(line));
|
CalibrationPoint cp(calibrationPoint(line));
|
||||||
if (cp.isValid())
|
if (cp.isValid())
|
||||||
_points.append(cp);
|
_points.append(cp);
|
||||||
else
|
else {
|
||||||
break;
|
if (_points.size() < 2) {
|
||||||
|
_errorString = line + ": invalid calibration point";
|
||||||
|
return false;
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ln++;
|
ln++;
|
||||||
}
|
}
|
||||||
|
|
||||||
device.close();
|
if (ln < 6) {
|
||||||
|
_errorString = "Unexpected EOF";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return (_points.size() >= 2);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
GmiFile::GmiFile(QIODevice &file)
|
GmiFile::GmiFile(QIODevice &file) : _valid(false)
|
||||||
{
|
{
|
||||||
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
|
_errorString = file.errorString();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_valid = parse(file);
|
_valid = parse(file);
|
||||||
|
|
||||||
|
file.close();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user