1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-27 21:24:47 +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/ll.h \
src/axisitem.h \
src/colorshop.h \
src/keys.h \
src/slideritem.h \
src/markeritem.h \
@ -33,7 +32,8 @@ HEADERS += src/config.h \
src/track.h \
src/graphview.h \
src/trackpoint.h \
src/waypointitem.h
src/waypointitem.h \
src/palette.h
SOURCES += src/main.cpp \
src/gui.cpp \
src/gpx.cpp \
@ -41,7 +41,6 @@ SOURCES += src/main.cpp \
src/poi.cpp \
src/ll.cpp \
src/axisitem.cpp \
src/colorshop.cpp \
src/slideritem.cpp \
src/markeritem.cpp \
src/infoitem.cpp \
@ -57,7 +56,8 @@ SOURCES += src/main.cpp \
src/trackview.cpp \
src/track.cpp \
src/graphview.cpp \
src/waypointitem.cpp
src/waypointitem.cpp \
src/palette.cpp
RESOURCES += gpxsee.qrc
TRANSLATIONS = lang/gpxsee_cs.ts
macx:ICON = icons/gpxsee.icns

View File

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

View File

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

View File

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

View File

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