Engauge Digitizer 2
Loading...
Searching...
No Matches
PointStyle.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 POINT_STYLE_H
8#define POINT_STYLE_H
9
10#include "ColorPalette.h"
11#include "PointShape.h"
12#include <QColor>
13#include <QPolygonF>
14
15class QTextStream;
16class QXmlStreamReader;
17class QXmlStreamWriter;
18
21{
22public:
24 PointStyle ();
25
27 PointStyle(PointShape pointShape,
28 unsigned int radius,
29 int lineWidth,
31
33 PointStyle (const PointStyle &other);
34
36 PointStyle &operator=(const PointStyle &other);
37
40
42 static PointStyle defaultGraphCurve (int index);
43
45 bool isCircle () const;
46
48 int lineWidth () const;
49
51 void loadXml(QXmlStreamReader &reader);
52
55
57 QPolygonF polygon () const;
58
60 void printStream (QString indentation,
61 QTextStream &str) const;
62
64 unsigned int radius () const;
65
67 void saveXml(QXmlStreamWriter &writer) const;
68
70 void setLineWidth (int width);
71
74
76 void setRadius (unsigned int radius);
77
80
82 PointShape shape () const;
83
84private:
85
86 PointShape m_shape;
87 unsigned int m_radius;
88 int m_lineWidth;
89 ColorPalette m_paletteColor;
90};
91
92#endif // POINT_STYLE_H
ColorPalette
PointShape
Definition PointShape.h:12
unsigned int radius() const
Radius of point. For a circle this is all that is needed to draw a circle. For a polygon,...
PointStyle & operator=(const PointStyle &other)
Assignment constructor.
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius.
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
void setPaletteColor(ColorPalette paletteColor)
Set method for point color.
bool isCircle() const
Return true if point is a circle, otherwise it is a polygon. For a circle, the radius is important an...
void setShape(PointShape shape)
Set method for point shape.
PointShape shape() const
Get method for point shape.
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
void setLineWidth(int width)
Set method for line width.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
static PointStyle defaultAxesCurve()
Initial default for axes curve.
ColorPalette paletteColor() const
Get method for point color.
void setRadius(unsigned int radius)
Set method for point radius.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
int lineWidth() const
Get method for line width.
PointStyle()
Default constructor only for use when this class is being stored by a container that requires the def...