1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Project structure refactoring

This commit is contained in:
Martin Tůma 2017-11-26 18:54:03 +01:00
parent 443b916301
commit 56e4c80999
182 changed files with 500 additions and 529 deletions

View File

@ -7,181 +7,182 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
lessThan(QT_VERSION, 5.4): QT += opengl
macx: QT += opengl
INCLUDEPATH += ./src
HEADERS += src/config.h \
src/icons.h \
src/gui.h \
src/poi.h \
src/rtree.h \
src/axisitem.h \
src/keys.h \
src/slideritem.h \
src/markeritem.h \
src/infoitem.h \
src/elevationgraph.h \
src/speedgraph.h \
src/sliderinfoitem.h \
src/filebrowser.h \
src/map.h \
src/onlinemap.h \
src/downloader.h \
src/units.h \
src/scaleitem.h \
src/waypoint.h \
src/track.h \
src/graphview.h \
src/trackpoint.h \
src/waypointitem.h \
src/palette.h \
src/heartrategraph.h \
src/range.h \
src/cpuarch.h \
src/settings.h \
src/app.h \
src/trackinfo.h \
src/exportdialog.h \
src/fileselectwidget.h \
src/margins.h \
src/temperaturegraph.h \
src/graphtab.h \
src/misc.h \
src/trackitem.h \
src/tooltip.h \
src/route.h \
src/routeitem.h \
src/graphitem.h \
src/graph.h \
src/pathitem.h \
src/pathview.h \
src/griditem.h \
src/data.h \
src/gpxparser.h \
src/tcxparser.h \
src/parser.h \
src/csvparser.h \
src/coordinates.h \
src/tile.h \
src/rd.h \
src/wgs84.h \
src/kmlparser.h \
src/trackdata.h \
src/routedata.h \
src/fitparser.h \
src/format.h \
src/path.h \
src/assert.h \
src/cadencegraph.h \
src/powergraph.h \
src/igcparser.h \
src/nmeaparser.h \
src/optionsdialog.h \
src/colorbox.h \
src/stylecombobox.h \
src/opengl.h \
src/timetype.h \
src/emptymap.h \
src/offlinemap.h \
src/matrix.h \
src/tar.h \
src/atlas.h \
src/projection.h \
src/mercator.h \
src/transversemercator.h \
src/latlon.h \
src/utm.h \
src/lambertconic.h \
src/ellipsoid.h \
src/ozf.h \
src/datum.h \
src/maplist.h \
src/albersequal.h \
src/oddspinbox.h \
src/rectc.h \
src/searchpointer.h \
src/percentslider.h \
src/elevationgraphitem.h \
src/speedgraphitem.h \
src/heartrategraphitem.h \
src/temperaturegraphitem.h \
src/cadencegraphitem.h \
src/powergraphitem.h \
src/lambertazimuthal.h
src/common/staticassert.h \
src/common/coordinates.h \
src/common/range.h \
src/common/rectc.h \
src/common/wgs84.h \
src/GUI/app.h \
src/GUI/icons.h \
src/GUI/gui.h \
src/GUI/axisitem.h \
src/GUI/keys.h \
src/GUI/slideritem.h \
src/GUI/markeritem.h \
src/GUI/infoitem.h \
src/GUI/elevationgraph.h \
src/GUI/speedgraph.h \
src/GUI/sliderinfoitem.h \
src/GUI/filebrowser.h \
src/GUI/units.h \
src/GUI/scaleitem.h \
src/GUI/graphview.h \
src/GUI/waypointitem.h \
src/GUI/palette.h \
src/GUI/heartrategraph.h \
src/GUI/trackinfo.h \
src/GUI/exportdialog.h \
src/GUI/fileselectwidget.h \
src/GUI/margins.h \
src/GUI/temperaturegraph.h \
src/GUI/graphtab.h \
src/GUI/trackitem.h \
src/GUI/tooltip.h \
src/GUI/routeitem.h \
src/GUI/graphitem.h \
src/GUI/pathitem.h \
src/GUI/pathview.h \
src/GUI/griditem.h \
src/GUI/format.h \
src/GUI/cadencegraph.h \
src/GUI/powergraph.h \
src/GUI/optionsdialog.h \
src/GUI/colorbox.h \
src/GUI/stylecombobox.h \
src/GUI/opengl.h \
src/GUI/timetype.h \
src/GUI/percentslider.h \
src/GUI/elevationgraphitem.h \
src/GUI/speedgraphitem.h \
src/GUI/heartrategraphitem.h \
src/GUI/temperaturegraphitem.h \
src/GUI/cadencegraphitem.h \
src/GUI/powergraphitem.h \
src/GUI/oddspinbox.h \
src/GUI/settings.h \
src/GUI/nicenum.h \
src/GUI/cpuarch.h \
src/GUI/searchpointer.h \
src/map/projection.h \
src/map/ellipsoid.h \
src/map/datum.h \
src/map/mercator.h \
src/map/transversemercator.h \
src/map/latlon.h \
src/map/utm.h \
src/map/lambertconic.h \
src/map/lambertazimuthal.h \
src/map/albersequal.h \
src/map/map.h \
src/map/maplist.h \
src/map/onlinemap.h \
src/map/downloader.h \
src/map/tile.h \
src/map/emptymap.h \
src/map/offlinemap.h \
src/map/tar.h \
src/map/ozf.h \
src/map/atlas.h \
src/map/matrix.h \
src/map/misc.h \
src/data/graph.h \
src/data/poi.h \
src/data/waypoint.h \
src/data/track.h \
src/data/route.h \
src/data/trackpoint.h \
src/data/data.h \
src/data/parser.h \
src/data/trackdata.h \
src/data/routedata.h \
src/data/path.h \
src/data/rtree.h \
src/data/gpxparser.h \
src/data/tcxparser.h \
src/data/csvparser.h \
src/data/kmlparser.h \
src/data/fitparser.h \
src/data/igcparser.h \
src/data/nmeaparser.h \
src/data/str2int.h
SOURCES += src/main.cpp \
src/gui.cpp \
src/poi.cpp \
src/axisitem.cpp \
src/slideritem.cpp \
src/markeritem.cpp \
src/infoitem.cpp \
src/elevationgraph.cpp \
src/speedgraph.cpp \
src/sliderinfoitem.cpp \
src/filebrowser.cpp \
src/onlinemap.cpp \
src/downloader.cpp \
src/scaleitem.cpp \
src/track.cpp \
src/graphview.cpp \
src/waypointitem.cpp \
src/palette.cpp \
src/heartrategraph.cpp \
src/range.cpp \
src/app.cpp \
src/trackinfo.cpp \
src/exportdialog.cpp \
src/fileselectwidget.cpp \
src/temperaturegraph.cpp \
src/trackpoint.cpp \
src/misc.cpp \
src/waypoint.cpp \
src/trackitem.cpp \
src/tooltip.cpp \
src/route.cpp \
src/routeitem.cpp \
src/graphitem.cpp \
src/pathitem.cpp \
src/pathview.cpp \
src/griditem.cpp \
src/data.cpp \
src/gpxparser.cpp \
src/tcxparser.cpp \
src/csvparser.cpp \
src/coordinates.cpp \
src/kmlparser.cpp \
src/fitparser.cpp \
src/format.cpp \
src/graph.cpp \
src/cadencegraph.cpp \
src/powergraph.cpp \
src/igcparser.cpp \
src/path.cpp \
src/nmeaparser.cpp \
src/optionsdialog.cpp \
src/colorbox.cpp \
src/stylecombobox.cpp \
src/emptymap.cpp \
src/offlinemap.cpp \
src/matrix.cpp \
src/tar.cpp \
src/atlas.cpp \
src/mercator.cpp \
src/transversemercator.cpp \
src/utm.cpp \
src/lambertconic.cpp \
src/ellipsoid.cpp \
src/ozf.cpp \
src/datum.cpp \
src/maplist.cpp \
src/albersequal.cpp \
src/oddspinbox.cpp \
src/rectc.cpp \
src/percentslider.cpp \
src/elevationgraphitem.cpp \
src/speedgraphitem.cpp \
src/heartrategraphitem.cpp \
src/temperaturegraphitem.cpp \
src/cadencegraphitem.cpp \
src/powergraphitem.cpp \
src/lambertazimuthal.cpp
src/common/coordinates.cpp \
src/common/rectc.cpp \
src/common/range.cpp \
src/GUI/app.cpp \
src/GUI/gui.cpp \
src/GUI/axisitem.cpp \
src/GUI/slideritem.cpp \
src/GUI/markeritem.cpp \
src/GUI/infoitem.cpp \
src/GUI/elevationgraph.cpp \
src/GUI/speedgraph.cpp \
src/GUI/sliderinfoitem.cpp \
src/GUI/filebrowser.cpp \
src/GUI/scaleitem.cpp \
src/GUI/graphview.cpp \
src/GUI/waypointitem.cpp \
src/GUI/palette.cpp \
src/GUI/heartrategraph.cpp \
src/GUI/trackinfo.cpp \
src/GUI/exportdialog.cpp \
src/GUI/fileselectwidget.cpp \
src/GUI/temperaturegraph.cpp \
src/GUI/trackitem.cpp \
src/GUI/tooltip.cpp \
src/GUI/routeitem.cpp \
src/GUI/graphitem.cpp \
src/GUI/pathitem.cpp \
src/GUI/pathview.cpp \
src/GUI/griditem.cpp \
src/GUI/format.cpp \
src/GUI/cadencegraph.cpp \
src/GUI/powergraph.cpp \
src/GUI/optionsdialog.cpp \
src/GUI/colorbox.cpp \
src/GUI/stylecombobox.cpp \
src/GUI/oddspinbox.cpp \
src/GUI/percentslider.cpp \
src/GUI/elevationgraphitem.cpp \
src/GUI/speedgraphitem.cpp \
src/GUI/heartrategraphitem.cpp \
src/GUI/temperaturegraphitem.cpp \
src/GUI/cadencegraphitem.cpp \
src/GUI/powergraphitem.cpp \
src/GUI/nicenum.cpp \
src/map/maplist.cpp \
src/map/onlinemap.cpp \
src/map/downloader.cpp \
src/map/emptymap.cpp \
src/map/offlinemap.cpp \
src/map/tar.cpp \
src/map/atlas.cpp \
src/map/ozf.cpp \
src/map/matrix.cpp \
src/map/ellipsoid.cpp \
src/map/datum.cpp \
src/map/projection.cpp \
src/map/mercator.cpp \
src/map/transversemercator.cpp \
src/map/utm.cpp \
src/map/lambertconic.cpp \
src/map/albersequal.cpp \
src/map/lambertazimuthal.cpp \
src/data/data.cpp \
src/data/poi.cpp \
src/data/track.cpp \
src/data/route.cpp \
src/data/path.cpp \
src/data/gpxparser.cpp \
src/data/tcxparser.cpp \
src/data/csvparser.cpp \
src/data/kmlparser.cpp \
src/data/fitparser.cpp \
src/data/igcparser.cpp \
src/data/nmeaparser.cpp \
src/data/str2int.cpp
RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts \
lang/gpxsee_sv.ts \

View File

@ -4,10 +4,10 @@
#include <QFileOpenEvent>
#include <QNetworkProxyFactory>
#include <QLibraryInfo>
#include "map/onlinemap.h"
#include "map/downloader.h"
#include "opengl.h"
#include "gui.h"
#include "onlinemap.h"
#include "downloader.h"
#include "app.h"

View File

@ -1,7 +1,7 @@
#include <cmath>
#include <QPainter>
#include "config.h"
#include "misc.h"
#include "nicenum.h"
#include "axisitem.h"

View File

@ -2,7 +2,7 @@
#define AXISITEM_H
#include <QGraphicsItem>
#include "range.h"
#include "common/range.h"
class AxisItem : public QGraphicsItem
{

View File

@ -1,4 +1,4 @@
#include "data.h"
#include "data/data.h"
#include "cadencegraphitem.h"
#include "cadencegraph.h"

View File

@ -1,6 +1,6 @@
#include <cmath>
#include "data/data.h"
#include "config.h"
#include "data.h"
#include "tooltip.h"
#include "elevationgraphitem.h"
#include "elevationgraph.h"

View File

@ -1,5 +1,5 @@
#include <QApplication>
#include "coordinates.h"
#include "common/coordinates.h"
#include "format.h"
QString Format::timeSpan(qreal time, bool full)

View File

@ -3,8 +3,8 @@
#include <QGraphicsObject>
#include <QPen>
#include "data/graph.h"
#include "units.h"
#include "graph.h"
class GraphItem : public QGraphicsObject
{

View File

@ -3,6 +3,7 @@
#include <QMouseEvent>
#include <QPaintEngine>
#include <QPaintDevice>
#include "data/graph.h"
#include "opengl.h"
#include "config.h"
#include "axisitem.h"
@ -10,7 +11,6 @@
#include "sliderinfoitem.h"
#include "infoitem.h"
#include "griditem.h"
#include "graph.h"
#include "graphitem.h"
#include "pathitem.h"
#include "format.h"

View File

@ -4,7 +4,7 @@
#include <QGraphicsView>
#include <QList>
#include <QSet>
#include "graph.h"
#include "data/graph.h"
#include "palette.h"
#include "units.h"

View File

@ -22,16 +22,16 @@
#include <QMimeData>
#include <QUrl>
#include <QPixmapCache>
#include "data/data.h"
#include "map/ellipsoid.h"
#include "map/datum.h"
#include "map/map.h"
#include "map/maplist.h"
#include "map/emptymap.h"
#include "config.h"
#include "icons.h"
#include "keys.h"
#include "settings.h"
#include "data.h"
#include "ellipsoid.h"
#include "datum.h"
#include "map.h"
#include "maplist.h"
#include "emptymap.h"
#include "elevationgraph.h"
#include "speedgraph.h"
#include "heartrategraph.h"

View File

@ -6,14 +6,13 @@
#include <QList>
#include <QDate>
#include <QPrinter>
#include "data/graph.h"
#include "data/poi.h"
#include "units.h"
#include "timetype.h"
#include "graph.h"
#include "poi.h"
#include "exportdialog.h"
#include "optionsdialog.h"
class QMenu;
class QToolBar;
class QTabWidget;

View File

@ -1,4 +1,4 @@
#include "data.h"
#include "data/data.h"
#include "heartrategraphitem.h"
#include "heartrategraph.h"

View File

@ -1,7 +1,5 @@
#include <cmath>
#include <cctype>
#include "misc.h"
#include "nicenum.h"
double niceNum(double x, int round)
{
@ -34,23 +32,3 @@ double niceNum(double x, int round)
return nf * pow(10.0, expv);
}
int str2int(const char *str, int len)
{
int res = 0;
for (const char *sp = str; sp < str + len; sp++) {
if (::isdigit(*sp))
res = res * 10 + *sp - '0';
else
return -1;
}
return res;
}
QRectF scaled(const QRectF &rect, qreal factor)
{
return QRectF(QPointF(rect.left() * factor, rect.top() * factor),
QSizeF(rect.width() * factor, rect.height() * factor));
}

6
src/GUI/nicenum.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef MISC_H
#define MISC_H
double niceNum(double x, int round);
#endif // MISC_H

View File

@ -2,9 +2,9 @@
#include <QApplication>
#include <QCursor>
#include <QPainter>
#include "map/map.h"
#include "tooltip.h"
#include "map.h"
#include "misc.h"
#include "nicenum.h"
#include "pathitem.h"

View File

@ -3,9 +3,8 @@
#include <QGraphicsObject>
#include <QPen>
#include "data/path.h"
#include "markeritem.h"
#include "path.h"
class Map;

View File

@ -4,11 +4,10 @@
#include <QApplication>
#include <QPixmapCache>
#include <QScrollBar>
#include "data/poi.h"
#include "data/data.h"
#include "map/map.h"
#include "opengl.h"
#include "misc.h"
#include "poi.h"
#include "data.h"
#include "map.h"
#include "trackitem.h"
#include "routeitem.h"
#include "waypointitem.h"
@ -116,6 +115,7 @@ PathItem *PathView::addTrack(const Track &track)
ti->setDigitalZoom(_digitalZoom);
_scene->addItem(ti);
if (_showTracks)
addPOI(_poi->points(ti->path()));
return ti;
@ -141,6 +141,7 @@ PathItem *PathView::addRoute(const Route &route)
ri->setDigitalZoom(_digitalZoom);
_scene->addItem(ri);
if (_showRoutes)
addPOI(_poi->points(ri->path()));
return ri;
@ -162,9 +163,10 @@ void PathView::addWaypoints(const QList<Waypoint> &waypoints)
wi->setVisible(_showWaypoints);
wi->setDigitalZoom(_digitalZoom);
_scene->addItem(wi);
}
addPOI(_poi->points(waypoints));
if (_showWaypoints)
addPOI(_poi->points(w));
}
}
QList<PathItem *> PathView::loadData(const Data &data)
@ -320,16 +322,20 @@ void PathView::updatePOI()
}
_pois.clear();
if (_showTracks)
for (int i = 0; i < _tracks.size(); i++)
addPOI(_poi->points(_tracks.at(i)->path()));
if (_showRoutes)
for (int i = 0; i < _routes.size(); i++)
addPOI(_poi->points(_routes.at(i)->path()));
addPOI(_poi->points(_waypoints));
if (_showWaypoints)
for (int i = 0; i< _waypoints.size(); i++)
addPOI(_poi->points(_waypoints.at(i)->waypoint()));
updatePOIVisibility();
}
void PathView::addPOI(const QVector<Waypoint> &waypoints)
void PathView::addPOI(const QList<Waypoint> &waypoints)
{
for (int i = 0; i < waypoints.size(); i++) {
const Waypoint &w = waypoints.at(i);
@ -586,6 +592,8 @@ void PathView::showTracks(bool show)
for (int i = 0; i < _tracks.count(); i++)
_tracks.at(i)->setVisible(show);
updatePOI();
}
void PathView::showRoutes(bool show)
@ -594,6 +602,8 @@ void PathView::showRoutes(bool show)
for (int i = 0; i < _routes.count(); i++)
_routes.at(i)->setVisible(show);
updatePOI();
}
void PathView::showWaypoints(bool show)
@ -602,6 +612,8 @@ void PathView::showWaypoints(bool show)
for (int i = 0; i < _waypoints.count(); i++)
_waypoints.at(i)->setVisible(show);
updatePOI();
}
void PathView::showWaypointLabels(bool show)

View File

@ -5,11 +5,11 @@
#include <QVector>
#include <QHash>
#include <QList>
#include "common/rectc.h"
#include "data/waypoint.h"
#include "searchpointer.h"
#include "units.h"
#include "palette.h"
#include "waypoint.h"
#include "rectc.h"
#include "searchpointer.h"
class Data;
class POI;
@ -77,7 +77,7 @@ private:
PathItem *addTrack(const Track &track);
PathItem *addRoute(const Route &route);
void addWaypoints(const QList<Waypoint> &waypoints);
void addPOI(const QVector<Waypoint> &waypoints);
void addPOI(const QList<Waypoint> &waypoints);
void loadPOI();
void clearPOI();

View File

@ -1,4 +1,4 @@
#include "data.h"
#include "data/data.h"
#include "powergraphitem.h"
#include "powergraph.h"

View File

@ -1,9 +1,9 @@
#include <QPainter>
#include "data/waypoint.h"
#include "map/map.h"
#include "format.h"
#include "waypoint.h"
#include "waypointitem.h"
#include "tooltip.h"
#include "map.h"
#include "routeitem.h"

View File

@ -1,8 +1,8 @@
#ifndef ROUTEITEM_H
#define ROUTEITEM_H
#include "data/route.h"
#include "pathitem.h"
#include "route.h"
#include "units.h"
class Map;

View File

@ -1,7 +1,7 @@
#include <cmath>
#include <QPainter>
#include "config.h"
#include "misc.h"
#include "nicenum.h"
#include "scaleitem.h"

View File

@ -1,5 +1,5 @@
#include "data/data.h"
#include "config.h"
#include "data.h"
#include "tooltip.h"
#include "speedgraphitem.h"
#include "speedgraph.h"

View File

@ -1,4 +1,4 @@
#include "data.h"
#include "data/data.h"
#include "temperaturegraphitem.h"
#include "temperaturegraph.h"

View File

@ -1,7 +1,7 @@
#include <QPainter>
#include "map/map.h"
#include "format.h"
#include "tooltip.h"
#include "map.h"
#include "trackitem.h"

View File

@ -3,7 +3,7 @@
#include <QDateTime>
#include <QPen>
#include "track.h"
#include "data/track.h"
#include "pathitem.h"
#include "units.h"

View File

@ -3,9 +3,9 @@
#include <cmath>
#include <QGraphicsItem>
#include "waypoint.h"
#include "data/waypoint.h"
#include "map/map.h"
#include "units.h"
#include "map.h"
class WaypointItem : public QGraphicsItem
{

View File

@ -1,4 +1,3 @@
#include "rd.h"
#include "wgs84.h"
#include "coordinates.h"
@ -17,10 +16,9 @@ qreal Coordinates::distanceTo(const Coordinates &c) const
return (WGS84_RADIUS * (2.0 * atan2(sqrt(a), sqrt(1.0 - a))));
}
QDebug operator<<(QDebug dbg, const Coordinates &coordinates)
QDebug operator<<(QDebug dbg, const Coordinates &c)
{
dbg.nospace() << "Coordinates(" << coordinates.lon() << ", "
<< coordinates.lat() << ")";
dbg.nospace() << "Coordinates(" << c.lon() << ", " << c.lat() << ")";
return dbg.space();
}

View File

@ -5,6 +5,12 @@
#include <QPair>
#include <QDebug>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif // M_PI
#define deg2rad(d) (((d)*M_PI)/180.0)
#define rad2deg(d) (((d)*180.0)/M_PI)
class Coordinates
{
public:
@ -37,6 +43,6 @@ inline bool operator==(const Coordinates &c1, const Coordinates &c2)
inline bool operator!=(const Coordinates &c1, const Coordinates &c2)
{return !(c1 == c2);}
QDebug operator<<(QDebug dbg, const Coordinates &trackpoint);
QDebug operator<<(QDebug dbg, const Coordinates &c);
#endif // COORDINATES_H

Some files were not shown because too many files have changed in this diff Show More