12 #include <QTextStream>
13 #include <QXmlStreamWriter>
24 m_fillCorners (false),
31 m_pointSeparation (document.modelSegments().pointSeparation()),
32 m_minLength (document.modelSegments().minLength()),
33 m_fillCorners (document.modelSegments().fillCorners()),
34 m_lineWidth (document.modelSegments().lineWidth()),
35 m_lineColor (document.modelSegments().lineColor())
40 m_pointSeparation (other.pointSeparation()),
41 m_minLength (other.minLength()),
42 m_fillCorners (other.fillCorners ()),
43 m_lineWidth (other.lineWidth()),
44 m_lineColor (other.lineColor())
81 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
91 reader.raiseError(QObject::tr (
"Cannot read segment data"));
102 return m_pointSeparation;
106 QTextStream &str)
const
108 str << indentation <<
"DocumentModelSegments\n";
112 str << indentation <<
"pointSeparation=" << m_pointSeparation <<
"\n";
113 str << indentation <<
"minLength=" << m_minLength <<
"\n";
114 str << indentation <<
"fillCorners=" << (m_fillCorners ?
"true" :
"false") <<
"\n";
115 str << indentation <<
"lineWidth=" << m_lineWidth <<
"\n";
132 writer.writeEndElement();
const QString DOCUMENT_SERIALIZE_SEGMENTS
const QString DOCUMENT_SERIALIZE_SEGMENTS_POINT_SEPARATION
ColorPalette lineColor() const
Get method for line color.
const ColorPalette DEFAULT_LINE_COLOR
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
void setLineColor(ColorPalette lineColor)
Set method for line color.
QString colorPaletteToString(ColorPalette colorPalette)
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_WIDTH
const QString INDENTATION_DELTA
void setMinLength(double minLength)
Set method for min length.
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_COLOR
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
const double DEFAULT_POINT_SEPARATION
#define LOG4CPP_INFO_S(logger)
const QString DOCUMENT_SERIALIZE_BOOL_TRUE
const QString DOCUMENT_SERIALIZE_SEGMENTS_FILL_CORNERS
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
double pointSeparation() const
Get method for point separation.
void setLineWidth(double lineWidth)
Set method for line width.
const QString DOCUMENT_SERIALIZE_BOOL_FALSE
void setFillCorners(bool fillCorners)
Set method for fill corners.
const double DEFAULT_LINE_WIDTH
Storage of one imported image and the data attached to that image.
double lineWidth() const
Get method for line width.
DocumentModelSegments()
Default constructor.
DocumentModelSegments & operator=(const DocumentModelSegments &other)
Assignment constructor.
log4cpp::Category * mainCat
const double DEFAULT_MIN_LENGTH
double minLength() const
Get method for min length.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsSegments and CmdSettingsSegments.
const QString DOCUMENT_SERIALIZE_SEGMENTS_MIN_LENGTH
void setPointSeparation(double pointSeparation)
Set method for point separation.
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_COLOR_STRING
bool fillCorners() const
Get method for fill corners.