Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CurveStyle Class Reference

Container for LineStyle and PointStyle for one Curve. More...

#include <CurveStyle.h>

Collaboration diagram for CurveStyle:
Collaboration graph

Public Member Functions

 CurveStyle ()
 Default constructor.
 
 CurveStyle (const LineStyle &lineStyle, const PointStyle &pointStyle)
 Constructor with styles.
 
LineStyle lineStyle () const
 Get method for LineStyle.
 
QString loadXml (QXmlStreamReader &reader)
 Load from serialized xml. Returns the curve name.
 
PointStyle pointStyle () const
 Get method for PointStyle.
 
void printStream (QString indentation, QTextStream &str) const
 Debugging method that supports print method of this class and printStream method of some other class(es)
 
void saveXml (QXmlStreamWriter &writer, const QString &curveName) const
 Serialize to xml.
 
void setLineColor (ColorPalette lineColor)
 Set method for line color in specified curve.
 
void setLineConnectAs (CurveConnectAs curveConnectAs)
 Set method for connect as method for lines in specified curve.
 
void setLineStyle (const LineStyle &lineStyle)
 Set method for LineStyle.
 
void setLineWidth (int width)
 Set method for line width in specified curve.
 
void setPointColor (ColorPalette curveColor)
 Set method curve point color in specified curve.
 
void setPointLineWidth (int width)
 Set method for curve point perimeter line width.
 
void setPointRadius (int radius)
 Set method for curve point radius.
 
void setPointShape (PointShape shape)
 Set method for curve point shape in specified curve.
 
void setPointStyle (const PointStyle &pointStyle)
 Set method for PointStyle.
 

Detailed Description

Container for LineStyle and PointStyle for one Curve.

Definition at line 18 of file CurveStyle.h.

Constructor & Destructor Documentation

◆ CurveStyle() [1/2]

CurveStyle::CurveStyle ( )

Default constructor.

Definition at line 15 of file CurveStyle.cpp.

16{
17}

◆ CurveStyle() [2/2]

CurveStyle::CurveStyle ( const LineStyle & lineStyle,
const PointStyle & pointStyle )

Constructor with styles.

Definition at line 19 of file CurveStyle.cpp.

20 :
21 m_pointStyle (pointStyle),
22 m_lineStyle (lineStyle)
23{
24}
LineStyle lineStyle() const
Get method for LineStyle.
PointStyle pointStyle() const
Get method for PointStyle.

Member Function Documentation

◆ lineStyle()

LineStyle CurveStyle::lineStyle ( ) const

Get method for LineStyle.

Definition at line 26 of file CurveStyle.cpp.

27{
28 return m_lineStyle;
29}

◆ loadXml()

QString CurveStyle::loadXml ( QXmlStreamReader & reader)

Load from serialized xml. Returns the curve name.

Definition at line 31 of file CurveStyle.cpp.

32{
33 LOG4CPP_INFO_S ((*mainCat)) << "CurveStyle::loadXml";
34
35 bool success = true;
36 QString curveName;
37
39
40 if (attributes.hasAttribute(DOCUMENT_SERIALIZE_CURVE_NAME)) {
41
42 curveName = attributes.value (DOCUMENT_SERIALIZE_CURVE_NAME).toString();
43
44 // Read until end of this subtree
45 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
48
49 if (reader.atEnd()) {
50 success = false;
51 break;
52 }
53
54 if ((reader.tokenType() == QXmlStreamReader::StartElement) &&
56
57 m_lineStyle.loadXml (reader);
58
59 } else if ((reader.tokenType() == QXmlStreamReader::StartElement) &
61
62 m_pointStyle.loadXml (reader);
63
64 }
65 }
66 }
67
68 if (!success) {
69 reader.raiseError (QObject::tr ("Cannot read curve style data"));
70 }
71
72 return curveName;
73}
const int INNER_RADIUS_MIN
const QString DOCUMENT_SERIALIZE_LINE_STYLE
const QString DOCUMENT_SERIALIZE_CURVE_NAME
const QString DOCUMENT_SERIALIZE_POINT_STYLE
log4cpp::Category * mainCat
Definition Logger.cpp:14
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
Definition Xml.cpp:14
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ pointStyle()

PointStyle CurveStyle::pointStyle ( ) const

Get method for PointStyle.

Definition at line 75 of file CurveStyle.cpp.

76{
77 return m_pointStyle;
78}

◆ printStream()

void CurveStyle::printStream ( QString indentation,
QTextStream & str ) const

Debugging method that supports print method of this class and printStream method of some other class(es)

Definition at line 80 of file CurveStyle.cpp.

82{
83 str << indentation << "CurveStyle\n";
84
86
87 m_pointStyle.printStream (indentation,
88 str);
89 m_lineStyle.printStream (indentation,
90 str);
91}
const QString INDENTATION_DELTA
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...

◆ saveXml()

void CurveStyle::saveXml ( QXmlStreamWriter & writer,
const QString & curveName ) const

Serialize to xml.

Definition at line 93 of file CurveStyle.cpp.

95{
96 LOG4CPP_INFO_S ((*mainCat)) << "CurveStyle::saveXml";
97
98 writer.writeStartElement(DOCUMENT_SERIALIZE_CURVE_STYLE);
99 writer.writeAttribute (DOCUMENT_SERIALIZE_CURVE_NAME, curveName);
100 m_lineStyle.saveXml (writer);
101 m_pointStyle.saveXml (writer);
102 writer.writeEndElement();
103}
const QString DOCUMENT_SERIALIZE_CURVE_STYLE
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.

◆ setLineColor()

void CurveStyle::setLineColor ( ColorPalette lineColor)

Set method for line color in specified curve.

Definition at line 105 of file CurveStyle.cpp.

106{
107 m_lineStyle.setPaletteColor(lineColor);
108}
void setPaletteColor(ColorPalette paletteColor)
Set method for line color.

◆ setLineConnectAs()

void CurveStyle::setLineConnectAs ( CurveConnectAs curveConnectAs)

Set method for connect as method for lines in specified curve.

Definition at line 110 of file CurveStyle.cpp.

111{
112 m_lineStyle.setCurveConnectAs(curveConnectAs);
113}
void setCurveConnectAs(CurveConnectAs curveConnectAs)
Set connect as.

◆ setLineStyle()

void CurveStyle::setLineStyle ( const LineStyle & lineStyle)

Set method for LineStyle.

Definition at line 115 of file CurveStyle.cpp.

116{
117 m_lineStyle = lineStyle;
118}

◆ setLineWidth()

void CurveStyle::setLineWidth ( int width)

Set method for line width in specified curve.

Definition at line 120 of file CurveStyle.cpp.

121{
122 m_lineStyle.setWidth(width);
123}
void setWidth(int width)
Set width of line.

◆ setPointColor()

void CurveStyle::setPointColor ( ColorPalette curveColor)

Set method curve point color in specified curve.

Definition at line 125 of file CurveStyle.cpp.

126{
127 m_pointStyle.setPaletteColor(curveColor);
128}
void setPaletteColor(ColorPalette paletteColor)
Set method for point color.

◆ setPointLineWidth()

void CurveStyle::setPointLineWidth ( int width)

Set method for curve point perimeter line width.

Definition at line 130 of file CurveStyle.cpp.

131{
132 m_pointStyle.setLineWidth(width);
133}
void setLineWidth(int width)
Set method for line width.

◆ setPointRadius()

void CurveStyle::setPointRadius ( int radius)

Set method for curve point radius.

Definition at line 135 of file CurveStyle.cpp.

136{
137 m_pointStyle.setRadius(radius);
138}
void setRadius(unsigned int radius)
Set method for point radius.

◆ setPointShape()

void CurveStyle::setPointShape ( PointShape shape)

Set method for curve point shape in specified curve.

Definition at line 140 of file CurveStyle.cpp.

141{
142 m_pointStyle.setShape(shape);
143}
void setShape(PointShape shape)
Set method for point shape.

◆ setPointStyle()

void CurveStyle::setPointStyle ( const PointStyle & pointStyle)

Set method for PointStyle.

Definition at line 145 of file CurveStyle.cpp.

146{
147 m_pointStyle = pointStyle;
148}

The documentation for this class was generated from the following files: