-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added git pre-commit hooks - Fixed mixed line-endings (final: \n) - Fixed clang-format errors - Updated legacy header
- Loading branch information
AmonRaNet
committed
Apr 26, 2020
1 parent
fb1ea3d
commit 3dfb906
Showing
88 changed files
with
8,086 additions
and
8,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
# C++ objects and libs | ||
*.slo | ||
*.lo | ||
*.o | ||
*.a | ||
*.la | ||
*.lai | ||
*.so | ||
*.dll | ||
*.dylib | ||
|
||
# Qt-es | ||
object_script.*.Release | ||
object_script.*.Debug | ||
*_plugin_import.cpp | ||
/.qmake.cache | ||
/.qmake.stash | ||
*.pro.user | ||
*.pro.user.* | ||
*.qbs.user | ||
*.qbs.user.* | ||
*.moc | ||
moc_*.cpp | ||
moc_*.h | ||
qrc_*.cpp | ||
ui_*.h | ||
*.qmlc | ||
*.jsc | ||
Makefile* | ||
*build* | ||
|
||
# Qt unit tests | ||
target_wrapper.* | ||
|
||
# QtCreator | ||
*.autosave | ||
|
||
# QtCreator Qml | ||
*.qmlproject.user | ||
*.qmlproject.user.* | ||
|
||
# QtCreator CMake | ||
CMakeLists.txt.user* | ||
# C++ objects and libs | ||
*.slo | ||
*.lo | ||
*.o | ||
*.a | ||
*.la | ||
*.lai | ||
*.so | ||
*.dll | ||
*.dylib | ||
|
||
# Qt-es | ||
object_script.*.Release | ||
object_script.*.Debug | ||
*_plugin_import.cpp | ||
/.qmake.cache | ||
/.qmake.stash | ||
*.pro.user | ||
*.pro.user.* | ||
*.qbs.user | ||
*.qbs.user.* | ||
*.moc | ||
moc_*.cpp | ||
moc_*.h | ||
qrc_*.cpp | ||
ui_*.h | ||
*.qmlc | ||
*.jsc | ||
Makefile* | ||
*build* | ||
|
||
# Qt unit tests | ||
target_wrapper.* | ||
|
||
# QtCreator | ||
*.autosave | ||
|
||
# QtCreator Qml | ||
*.qmlproject.user | ||
*.qmlproject.user.* | ||
|
||
# QtCreator CMake | ||
CMakeLists.txt.user* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: legacy-headers | ||
name: Update legacy headers | ||
entry: scripts/add_header.py | ||
args: [--apply,.,scripts/legacy_head.txt] | ||
language: script | ||
always_run: true | ||
pass_filenames: false | ||
stages: [commit] | ||
|
||
- repo: https://github.com/pocc/pre-commit-hooks | ||
rev: python | ||
hooks: | ||
- id: clang-format | ||
args: [-i] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
args: [--fix=lf] | ||
- id: check-added-large-files | ||
args: [--maxkb=100] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
TEMPLATE = subdirs | ||
SUBDIRS = lib \ | ||
demo | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
theme: jekyll-theme-cayman | ||
theme: jekyll-theme-cayman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,80 @@ | ||
/*************************************************************************** | ||
* QGeoView is a Qt / C ++ widget for visualizing geographic data. | ||
* Copyright (C) 2018-2019 Andrey Yaroshenko. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, see https://www.gnu.org/licenses. | ||
****************************************************************************/ | ||
|
||
#include "demoitem.h" | ||
|
||
DemoItem::DemoItem(QGVMap* geoMap, SelectorDialog::Type type, QObject* parent) | ||
: QObject(parent) | ||
, mGeoMap(geoMap) | ||
{ | ||
mSelectorDialog.reset(new SelectorDialog(type)); | ||
} | ||
|
||
QGVMap* DemoItem::geoMap() const | ||
{ | ||
return mGeoMap; | ||
} | ||
|
||
SelectorDialog* DemoItem::selector() const | ||
{ | ||
return mSelectorDialog.data(); | ||
} | ||
|
||
void DemoItem::init() | ||
{ | ||
onInit(); | ||
Q_EMIT ready(this); | ||
} | ||
void DemoItem::start() | ||
{ | ||
onStart(); | ||
Q_EMIT started(this); | ||
} | ||
void DemoItem::end() | ||
{ | ||
onEnd(); | ||
Q_EMIT ended(this); | ||
} | ||
|
||
QGV::GeoPos DemoItem::randPos(const QGV::GeoRect& targetArea) | ||
{ | ||
const double latRange = targetArea.latTop() - targetArea.latBottom(); | ||
const double lonRange = targetArea.lonRigth() - targetArea.lonLeft(); | ||
static const int range = 1000; | ||
return { targetArea.latBottom() + latRange * (qrand() % range) / range, | ||
targetArea.lonLeft() + lonRange * (qrand() % range) / range }; | ||
} | ||
|
||
QGV::GeoRect DemoItem::randRect(const QGV::GeoRect& targetArea, const QSizeF& size) | ||
{ | ||
const auto baseGeo = randPos(targetArea); | ||
const auto base = geoMap()->getProjection()->geoToProj(baseGeo); | ||
return geoMap()->getProjection()->projToGeo({ base, base + QPointF(size.width(), size.height()) }); | ||
} | ||
|
||
QGV::GeoRect DemoItem::randRect(const QGV::GeoRect& targetArea, int baseSize) | ||
{ | ||
const auto size = randSize(baseSize); | ||
return randRect(targetArea, size); | ||
} | ||
|
||
QSizeF DemoItem::randSize(int baseSize) | ||
{ | ||
const int range = -baseSize / 2; | ||
return QSize(baseSize + (qrand() % range), baseSize + (qrand() % range)); | ||
} | ||
/*************************************************************************** | ||
* QGeoView is a Qt / C ++ widget for visualizing geographic data. | ||
* Copyright (C) 2018-2020 Andrey Yaroshenko. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, see https://www.gnu.org/licenses. | ||
****************************************************************************/ | ||
|
||
#include "demoitem.h" | ||
|
||
DemoItem::DemoItem(QGVMap* geoMap, SelectorDialog::Type type, QObject* parent) | ||
: QObject(parent) | ||
, mGeoMap(geoMap) | ||
{ | ||
mSelectorDialog.reset(new SelectorDialog(type)); | ||
} | ||
|
||
QGVMap* DemoItem::geoMap() const | ||
{ | ||
return mGeoMap; | ||
} | ||
|
||
SelectorDialog* DemoItem::selector() const | ||
{ | ||
return mSelectorDialog.data(); | ||
} | ||
|
||
void DemoItem::init() | ||
{ | ||
onInit(); | ||
Q_EMIT ready(this); | ||
} | ||
void DemoItem::start() | ||
{ | ||
onStart(); | ||
Q_EMIT started(this); | ||
} | ||
void DemoItem::end() | ||
{ | ||
onEnd(); | ||
Q_EMIT ended(this); | ||
} | ||
|
||
QGV::GeoPos DemoItem::randPos(const QGV::GeoRect& targetArea) | ||
{ | ||
const double latRange = targetArea.latTop() - targetArea.latBottom(); | ||
const double lonRange = targetArea.lonRigth() - targetArea.lonLeft(); | ||
static const int range = 1000; | ||
return { targetArea.latBottom() + latRange * (qrand() % range) / range, | ||
targetArea.lonLeft() + lonRange * (qrand() % range) / range }; | ||
} | ||
|
||
QGV::GeoRect DemoItem::randRect(const QGV::GeoRect& targetArea, const QSizeF& size) | ||
{ | ||
const auto baseGeo = randPos(targetArea); | ||
const auto base = geoMap()->getProjection()->geoToProj(baseGeo); | ||
return geoMap()->getProjection()->projToGeo({ base, base + QPointF(size.width(), size.height()) }); | ||
} | ||
|
||
QGV::GeoRect DemoItem::randRect(const QGV::GeoRect& targetArea, int baseSize) | ||
{ | ||
const auto size = randSize(baseSize); | ||
return randRect(targetArea, size); | ||
} | ||
|
||
QSizeF DemoItem::randSize(int baseSize) | ||
{ | ||
const int range = -baseSize / 2; | ||
return QSize(baseSize + (qrand() % range), baseSize + (qrand() % range)); | ||
} |
Oops, something went wrong.