Engauge Digitizer 2
Loading...
Searching...
No Matches
CurveStyles.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef CURVE_STYLES_H
8#define CURVE_STYLES_H
9
10#include "ColorPalette.h"
11#include "CurveStyle.h"
12#include <QHash>
13#include <QString>
14
15class CoordSystem;
16class QXmlStreamReader;
17class QXmlStreamWriter;
18
19typedef QHash<QString, CurveStyle> CurveStylesInternal;
20
23{
24public:
27
29 CurveStyles(const CoordSystem &coordSystem);
30
32 CurveStyles (const CurveStyles &other);
33
35 CurveStyles &operator=(const CurveStyles &other);
36
38 QStringList curveNames () const;
39
41 CurveStyle curveStyle (const QString &curveName) const;
42
44 ColorPalette lineColor (const QString &curveName) const;
45
47 CurveConnectAs lineConnectAs (const QString &curveName) const;
48
50 const LineStyle lineStyle (const QString &curveName) const;
51
53 int lineWidth (const QString &curveName) const;
54
56 void loadXml (QXmlStreamReader &reader);
57
59 ColorPalette pointColor (const QString &curveName) const;
60
62 bool pointIsCircle (const QString &curveName) const;
63
65 int pointLineWidth (const QString &curveName) const;
66
68 QPolygonF pointPolygon (const QString &curveName) const;
69
71 int pointRadius (const QString &curveName) const;
72
74 PointShape pointShape(const QString &curveName) const;
75
77 const PointStyle pointStyle (const QString &curveName) const;
78
80 void saveXml(QXmlStreamWriter &writer) const;
81
83 void setCurveStyle (const QString &curveName,
84 const CurveStyle &curveStyle);
85
87 void setLineColor (const QString &curveName,
89
91 void setLineConnectAs (const QString &curveName,
92 CurveConnectAs curveConnectAs);
93
95 void setLineWidth (const QString &curveName,
96 int width);
97
99 void setPointColor (const QString &curveName,
100 ColorPalette curveColor);
101
103 void setPointIsCircle (const QString &curveName,
104 bool pointIsCircle);
105
107 void setPointLineWidth (const QString &curveName,
108 int width);
109
111 void setPointRadius (const QString &curveName,
112 int radius);
113
115 void setPointShape (const QString &curveName,
116 PointShape shape);
117
118private:
119
120 CurveStylesInternal m_curveStyles;
121
122};
123
124#endif // CURVE_STYLES_H
ColorPalette
CurveConnectAs
QHash< QString, CurveStyle > CurveStylesInternal
Definition CurveStyles.h:19
PointShape
Definition PointShape.h:12
Storage of data belonging to one coordinate system.
Definition CoordSystem.h:43
Container for LineStyle and PointStyle for one Curve.
Definition CurveStyle.h:19
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition CurveStyles.h:23
ColorPalette pointColor(const QString &curveName) const
Get method for curve point color in specified curve.
bool pointIsCircle(const QString &curveName) const
Get method for curve point is circle in specified curve.
void setPointIsCircle(const QString &curveName, bool pointIsCircle)
Set method for curve point is circle in specified curve.
const LineStyle lineStyle(const QString &curveName) const
Get method for copying one line style in one step.
void setPointRadius(const QString &curveName, int radius)
Set method for curve point radius.
void setPointLineWidth(const QString &curveName, int width)
Set method for curve point perimeter line width.
void setPointColor(const QString &curveName, ColorPalette curveColor)
Set method curve point color in specified curve.
ColorPalette lineColor(const QString &curveName) const
Get method for line color in specified curve.
int pointRadius(const QString &curveName) const
Get method for curve point radius.
void saveXml(QXmlStreamWriter &writer) const
Serialize to xml.
void loadXml(QXmlStreamReader &reader)
Load from serialized xml.
int pointLineWidth(const QString &curveName) const
Get method for curve point line width.
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
CurveConnectAs lineConnectAs(const QString &curveName) const
Get method for connect as method for lines in specified curve.
void setLineColor(const QString &curveName, ColorPalette lineColor)
Set method for line color in specified curve.
QPolygonF pointPolygon(const QString &curveName) const
Get method for curve point polygon in specified curve.
const PointStyle pointStyle(const QString &curveName) const
Get method for copying one point style. Cannot return just a reference or else there is a warning abo...
QStringList curveNames() const
List of all curve names.
int lineWidth(const QString &curveName) const
Get method for line width in specified curve.
void setCurveStyle(const QString &curveName, const CurveStyle &curveStyle)
Set method for curve style.
CurveStyles()
Default constructor.
void setPointShape(const QString &curveName, PointShape shape)
Set method for curve point shape in specified curve.
void setLineWidth(const QString &curveName, int width)
Set method for line width in specified curve.
CurveStyles & operator=(const CurveStyles &other)
Assignment constructor.
PointShape pointShape(const QString &curveName) const
Get method for curve point shape.
void setLineConnectAs(const QString &curveName, CurveConnectAs curveConnectAs)
Set method for connect as method for lines in specified curve.
Details for a specific Line.
Definition LineStyle.h:20
Details for a specific Point.
Definition PointStyle.h:21