Engauge Digitizer  2
PointStyle.h
1 #ifndef POINT_STYLE_H
2 #define POINT_STYLE_H
3 
4 #include "ColorPalette.h"
5 #include "PointShape.h"
6 #include <QColor>
7 #include <QPolygonF>
8 
9 class QTextStream;
10 class QXmlStreamReader;
11 class QXmlStreamWriter;
12 
15 {
16 public:
18  PointStyle ();
19 
21  PointStyle(PointShape pointShape,
22  unsigned int radius,
23  int lineWidth,
24  ColorPalette paletteColor);
25 
27  PointStyle (const PointStyle &other);
28 
30  PointStyle &operator=(const PointStyle &other);
31 
33  static PointStyle defaultAxesCurve ();
34 
36  static PointStyle defaultGraphCurve (int index);
37 
39  bool isCircle () const;
40 
42  int lineWidth () const;
43 
45  void loadXml(QXmlStreamReader &reader);
46 
48  ColorPalette paletteColor () const;
49 
51  QPolygonF polygon () const;
52 
54  void printStream (QString indentation,
55  QTextStream &str) const;
56 
58  int radius () const;
59 
61  void saveXml(QXmlStreamWriter &writer) const;
62 
64  void setLineWidth (int width);
65 
67  void setPaletteColor (ColorPalette paletteColor);
68 
70  void setRadius (int radius);
71 
73  void setShape (PointShape shape);
74 
76  PointShape shape () const;
77 
78 private:
79 
80  PointShape m_shape;
81  unsigned int m_radius;
82  int m_lineWidth;
83  ColorPalette m_paletteColor;
84 };
85 
86 #endif // POINT_STYLE_H
static PointStyle defaultAxesCurve()
Initial default for axes curve.
Definition: PointStyle.cpp:49
PointStyle()
Default constructor only for use when this class is being stored by a container that requires the def...
Definition: PointStyle.cpp:16
int lineWidth() const
Get method for line width.
Definition: PointStyle.cpp:77
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: PointStyle.cpp:198
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
Definition: PointStyle.cpp:82
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius...
Definition: PointStyle.cpp:113
void setShape(PointShape shape)
Set method for point shape.
Definition: PointStyle.cpp:245
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
Definition: PointStyle.cpp:216
Details for a specific Point.
Definition: PointStyle.h:14
ColorPalette paletteColor() const
Get method for point color.
Definition: PointStyle.cpp:108
int radius() const
Radius of point. For a circle this is all that is needed to draw a circle. For a polygon, the radius determines the size of the polygon.
Definition: PointStyle.cpp:211
void setPaletteColor(ColorPalette paletteColor)
Set method for point color.
Definition: PointStyle.cpp:235
bool isCircle() const
Return true if point is a circle, otherwise it is a polygon. For a circle, the radius is important an...
Definition: PointStyle.cpp:72
PointStyle & operator=(const PointStyle &other)
Assignment constructor.
Definition: PointStyle.cpp:39
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Definition: PointStyle.cpp:57
void setLineWidth(int width)
Set method for line width.
Definition: PointStyle.cpp:230
PointShape shape() const
Get method for point shape.
Definition: PointStyle.cpp:250
void setRadius(int radius)
Set method for point radius.
Definition: PointStyle.cpp:240