1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-02-17 16:20:48 +01:00

Refactoring

This commit is contained in:
Martin Tůma 2016-02-28 09:32:54 +01:00
parent ba4ac9fe51
commit a1ac09f615
5 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,6 @@ HEADERS += src/config.h \
src/rtree.h \ src/rtree.h \
src/ll.h \ src/ll.h \
src/axisitem.h \ src/axisitem.h \
src/colorshop.h \
src/keys.h \ src/keys.h \
src/slideritem.h \ src/slideritem.h \
src/markeritem.h \ src/markeritem.h \
@ -33,7 +32,8 @@ HEADERS += src/config.h \
src/track.h \ src/track.h \
src/graphview.h \ src/graphview.h \
src/trackpoint.h \ src/trackpoint.h \
src/waypointitem.h src/waypointitem.h \
src/palette.h
SOURCES += src/main.cpp \ SOURCES += src/main.cpp \
src/gui.cpp \ src/gui.cpp \
src/gpx.cpp \ src/gpx.cpp \
@ -41,7 +41,6 @@ SOURCES += src/main.cpp \
src/poi.cpp \ src/poi.cpp \
src/ll.cpp \ src/ll.cpp \
src/axisitem.cpp \ src/axisitem.cpp \
src/colorshop.cpp \
src/slideritem.cpp \ src/slideritem.cpp \
src/markeritem.cpp \ src/markeritem.cpp \
src/infoitem.cpp \ src/infoitem.cpp \
@ -57,7 +56,8 @@ SOURCES += src/main.cpp \
src/trackview.cpp \ src/trackview.cpp \
src/track.cpp \ src/track.cpp \
src/graphview.cpp \ src/graphview.cpp \
src/waypointitem.cpp src/waypointitem.cpp \
src/palette.cpp
RESOURCES += gpxsee.qrc RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts TRANSLATIONS = lang/gpxsee_cs.ts
macx:ICON = icons/gpxsee.icns macx:ICON = icons/gpxsee.icns

View File

@ -6,7 +6,7 @@
#include <QVector> #include <QVector>
#include <QList> #include <QList>
#include <QPointF> #include <QPointF>
#include "colorshop.h" #include "palette.h"
class AxisItem; class AxisItem;
@ -84,7 +84,7 @@ private:
QList<QGraphicsPathItem*> _graphs; QList<QGraphicsPathItem*> _graphs;
qreal _xMin, _xMax, _yMin, _yMax; qreal _xMin, _xMax, _yMin, _yMax;
ColorShop _colorShop; Palette _colorShop;
}; };
#endif // GRAPHVIEW_H #endif // GRAPHVIEW_H

View File

@ -1,4 +1,4 @@
#include "colorshop.h" #include "palette.h"
#define HUE_INIT 0.1f #define HUE_INIT 0.1f
@ -43,12 +43,12 @@ static unsigned hsv2rgb(float h, float s, float v)
+ (unsigned)(b * 256); + (unsigned)(b * 256);
} }
ColorShop::ColorShop() Palette::Palette()
{ {
_hueState = HUE_INIT; _hueState = HUE_INIT;
} }
QColor ColorShop::color() QColor Palette::color()
{ {
_hueState += HUE_INCREMENT; _hueState += HUE_INCREMENT;
_hueState -= (int) _hueState; _hueState -= (int) _hueState;
@ -56,7 +56,7 @@ QColor ColorShop::color()
return QColor(hsv2rgb(_hueState, SATURATION, VALUE)); return QColor(hsv2rgb(_hueState, SATURATION, VALUE));
} }
void ColorShop::reset() void Palette::reset()
{ {
_hueState = HUE_INIT; _hueState = HUE_INIT;
} }

View File

@ -1,12 +1,12 @@
#ifndef COLORSHOP_H #ifndef PALETTE_H
#define COLORSHOP_H #define PALETTE_H
#include <QColor> #include <QColor>
class ColorShop class Palette
{ {
public: public:
ColorShop(); Palette();
QColor color(); QColor color();
void reset(); void reset();
@ -14,4 +14,4 @@ private:
float _hueState; float _hueState;
}; };
#endif // COLORSHOP_H #endif // PALLETE_H

View File

@ -7,7 +7,7 @@
#include <QList> #include <QList>
#include <QPrinter> #include <QPrinter>
#include "units.h" #include "units.h"
#include "colorshop.h" #include "palette.h"
#include "waypoint.h" #include "waypoint.h"
class GPX; class GPX;
@ -65,7 +65,7 @@ private:
Map *_map; Map *_map;
ScaleItem *_mapScale; ScaleItem *_mapScale;
ColorShop _colorShop; Palette _colorShop;
qreal _maxLen; qreal _maxLen;
qreal _scale; qreal _scale;