Engauge Digitizer  2
CurveStyles.h
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 
15 class CoordSystem;
16 class QXmlStreamReader;
17 class QXmlStreamWriter;
18 
19 typedef QHash<QString, CurveStyle> CurveStylesInternal;
20 
23 {
24 public:
26  CurveStyles();
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,
88  ColorPalette lineColor);
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 
118 private:
119 
120  CurveStylesInternal m_curveStyles;
121 
122 };
123 
124 #endif // CURVE_STYLES_H
void setLineColor(const QString &curveName, ColorPalette lineColor)
Set method for line color in specified curve.
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
Definition: CurveStyles.cpp:79
void setLineConnectAs(const QString &curveName, CurveConnectAs curveConnectAs)
Set method for connect as method for lines in specified curve.
void setLineWidth(const QString &curveName, int width)
Set method for line width in specified curve.
CurveStyles()
Default constructor.
Definition: CurveStyles.cpp:18
void setPointLineWidth(const QString &curveName, int width)
Set method for curve point perimeter line width.
QStringList curveNames() const
List of all curve names.
Definition: CurveStyles.cpp:67
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
Definition: CurveStyles.h:22
int lineWidth(const QString &curveName) const
Get method for line width in specified curve.
CurveStyles & operator=(const CurveStyles &other)
Assignment constructor.
Definition: CurveStyles.cpp:53
Storage of data belonging to one coordinate system.
Definition: CoordSystem.h:42
void loadXml(QXmlStreamReader &reader)
Load from serialized xml.
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...
void saveXml(QXmlStreamWriter &writer) const
Serialize to xml.
PointShape pointShape(const QString &curveName) const
Get method for curve point shape.
bool pointIsCircle(const QString &curveName) const
Get method for curve point is circle in specified curve.
void setCurveStyle(const QString &curveName, const CurveStyle &curveStyle)
Set method for curve style.
ColorPalette pointColor(const QString &curveName) const
Get method for curve point color in specified curve.
Details for a specific Point.
Definition: PointStyle.h:20
QPolygonF pointPolygon(const QString &curveName) const
Get method for curve point polygon in specified curve.
const LineStyle lineStyle(const QString &curveName) const
Get method for copying one line style in one step.
Definition: CurveStyles.cpp:97
int pointRadius(const QString &curveName) const
Get method for curve point radius.
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:18
Details for a specific Line.
Definition: LineStyle.h:19
void setPointRadius(const QString &curveName, int radius)
Set method for curve point radius.
CurveConnectAs lineConnectAs(const QString &curveName) const
Get method for connect as method for lines in specified curve.
Definition: CurveStyles.cpp:91
void setPointIsCircle(const QString &curveName, bool pointIsCircle)
Set method for curve point is circle in specified curve.
ColorPalette lineColor(const QString &curveName) const
Get method for line color in specified curve.
Definition: CurveStyles.cpp:85
int pointLineWidth(const QString &curveName) const
Get method for curve point line width.
void setPointShape(const QString &curveName, PointShape shape)
Set method for curve point shape in specified curve.
void setPointColor(const QString &curveName, ColorPalette curveColor)
Set method curve point color in specified curve.