1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00
GPXSee/src/data/style.h

60 lines
1.3 KiB
C
Raw Normal View History

#ifndef STYLE_H
#define STYLE_H
#include <QPen>
#include <QBrush>
#include <QPixmap>
class PointStyle {
public:
PointStyle() : _size(-1) {}
PointStyle(const QPixmap &icon, const QColor &color = QColor(), int size = -1)
: _icon(icon), _color(color), _size(size) {}
2022-09-23 21:36:02 +02:00
PointStyle(const QColor &color, int size = -1)
: _color(color), _size(size) {}
const QColor &color() const {return _color;}
const QPixmap &icon() const {return _icon;}
int size() const {return _size;}
private:
QPixmap _icon;
QColor _color;
int _size;
};
class PolygonStyle {
public:
2022-09-23 21:36:02 +02:00
PolygonStyle() : _width(-1) {}
PolygonStyle(const QColor &fill, const QColor &stroke = QColor(),
qreal width = -1) : _fill(fill), _stroke(stroke), _width(width) {}
2022-09-23 21:36:02 +02:00
const QColor &fill() const {return _fill;}
const QColor &stroke() const {return _stroke;}
qreal width() const {return _width;}
bool isValid() const
2022-09-23 21:36:02 +02:00
{return _fill.isValid() || _stroke.isValid();}
private:
2022-09-23 21:36:02 +02:00
QColor _fill;
QColor _stroke;
qreal _width;
};
class LineStyle {
public:
LineStyle() : _width(-1) {}
2022-09-23 21:36:02 +02:00
LineStyle(const QColor &color, qreal width = -1)
: _color(color), _width(width) {}
const QColor &color() const {return _color;}
2022-09-23 21:36:02 +02:00
qreal width() const {return _width;}
private:
QColor _color;
2022-09-23 21:36:02 +02:00
qreal _width;
};
#endif // STYLE_H