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
Definition: ColorPalette.h:12
PointShape
Definition: PointShape.h:12
Details for a specific Point.
Definition: PointStyle.h:21
unsigned int radius() const
Radius of point. For a circle this is all that is needed to draw a circle. For a polygon,...
Definition: PointStyle.cpp:276
PointStyle & operator=(const PointStyle &other)
Assignment constructor.
Definition: PointStyle.cpp:57
QPolygonF polygon() const
Return the polygon for creating a QGraphicsPolygonItem. The size is determined by the radius.
Definition: PointStyle.cpp:160
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
Definition: PointStyle.cpp:129
void setPaletteColor(ColorPalette paletteColor)
Set method for point color.
Definition: PointStyle.cpp:300
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:119
void setShape(PointShape shape)
Set method for point shape.
Definition: PointStyle.cpp:310
PointShape shape() const
Get method for point shape.
Definition: PointStyle.cpp:315
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Definition: PointStyle.cpp:88
void setLineWidth(int width)
Set method for line width.
Definition: PointStyle.cpp:295
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:263
static PointStyle defaultAxesCurve()
Initial default for axes curve.
Definition: PointStyle.cpp:67
ColorPalette paletteColor() const
Get method for point color.
Definition: PointStyle.cpp:155
void setRadius(unsigned int radius)
Set method for point radius.
Definition: PointStyle.cpp:305
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
Definition: PointStyle.cpp:281
int lineWidth() const
Get method for line width.
Definition: PointStyle.cpp:124
PointStyle()
Default constructor only for use when this class is being stored by a container that requires the def...
Definition: PointStyle.cpp:29