15#include <QXmlStreamWriter>
32 m_valuesX (document.modelGuideline().
valuesX ()),
33 m_valuesY (document.modelGuideline().
valuesY ()),
35 m_lineColor (document.modelGuideline().
lineColor ()),
65 return m_creationCircleRadius;
75 return m_lineWidthActive;
80 return m_lineWidthInactive;
89 QXmlStreamAttributes attributes = reader.attributes();
103 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
108 if ((tokenType == QXmlStreamReader::StartElement) &&
111 loadXmlVector (reader,
116 if ((tokenType == QXmlStreamReader::StartElement) &&
119 loadXmlVector (reader,
124 if (reader.atEnd()) {
131 reader.raiseError (QObject::tr (
"Cannot read grid display data"));
135void DocumentModelGuideline::loadXmlVector (QXmlStreamReader &reader,
136 const QString &tokenEnd,
141 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
142 (reader.name() != tokenEnd)){
146 if (reader.atEnd()) {
150 if (tokenType == QXmlStreamReader::StartElement) {
158 guidelineValues [identifier] = value;
165 QTextStream &str)
const
167 str << indentation <<
"DocumentModelGuideline\n";
173 GuidelineValues::const_iterator itr;
175 for (itr = m_valuesX.constBegin(); itr != m_valuesX.constEnd(); itr++) {
176 strX << delimiterX << itr.value();
180 for (itr = m_valuesY.constBegin(); itr != m_valuesY.constEnd(); itr++) {
181 strY << delimiterY << itr.value();
185 str << indentation <<
"valuesX=" <<
valuesX <<
"\n";
186 str << indentation <<
"valuesY=" <<
valuesY <<
"\n";
187 str << indentation <<
"creationCircleRadius=" << m_creationCircleRadius <<
"\n";
189 str << indentation <<
"lineWidthActive=" << m_lineWidthActive <<
"\n";
190 str << indentation <<
"lineWidthInactive=" << m_lineWidthInactive <<
"\n";
203 saveXmlVector (writer,
206 saveXmlVector (writer,
209 writer.writeEndElement();
212void DocumentModelGuideline::saveXmlVector(QXmlStreamWriter &writer,
213 const QString &tokenAll,
216 writer.writeStartElement(tokenAll);
219 GuidelineValues::const_iterator itr;
220 for (itr = values.begin(); itr != values.end(); itr++) {
221 QString identifier = itr.key();
222 double value = itr.value();
226 writer.writeEndElement ();
229 writer.writeEndElement();
234 m_creationCircleRadius = radius;
QString colorPaletteToString(ColorPalette colorPalette)
const ColorPalette DEFAULT_LINE_COLOR
const double DEFAULT_LINE_WIDTH_ACTIVE
const double DEFAULT_LINE_WIDTH_INACTIVE
const double DEFAULT_CREATION_CIRCLE_RADIUS
const QString DOCUMENT_SERIALIZE_GUIDELINE_LINE_WIDTH_INACTIVE
const QString DOCUMENT_SERIALIZE_GUIDELINE_CREATION_CIRCLE_RADIUS
const QString DOCUMENT_SERIALIZE_GUIDELINE_LINE_WIDTH_ACTIVE
const QString DOCUMENT_SERIALIZE_GUIDELINES
const QString DOCUMENT_SERIALIZE_GUIDELINE
const QString DOCUMENT_SERIALIZE_GUIDELINE_LINE_COLOR_STRING
const QString DOCUMENT_SERIALIZE_GUIDELINE_VALUE
const QString DOCUMENT_SERIALIZE_GUIDELINE_LINE_COLOR
const QString DOCUMENT_SERIALIZE_GUIDELINES_Y
const QString DOCUMENT_SERIALIZE_GUIDELINE_IDENTIFIER
const QString DOCUMENT_SERIALIZE_GUIDELINES_X
QMap< QString, double > GuidelineValues
log4cpp::Category * mainCat
const QString INDENTATION_DELTA
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
void setLineColor(ColorPalette lineColor)
Set method for line color.
void setLineWidthInactive(double lineWidth)
Set method for line width when inactive.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void setCreationCircleRadius(double radius)
Set method for creation circle radius in pixels.
DocumentModelGuideline()
Default constructor.
DocumentModelGuideline & operator=(const DocumentModelGuideline &other)
Assignment constructor.
void setLineWidthActive(double lineWidth)
Set method for line width when active.
GuidelineValues valuesY() const
Get method for y/r values.
double lineWidthInactive() const
Get method for line width when inactive.
double creationCircleRadius() const
Get method for creation circle radius in pixels.
GuidelineValues valuesX() const
Get method for x/t values.
void setValuesY(const GuidelineValues &valuesY)
Set method for y/r values.
ColorPalette lineColor() const
Get method for 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(...
void setValuesX(const GuidelineValues &valuesX)
Set method for x/t values.
double lineWidthActive() const
Get method for line width when active.
Storage of one imported image and the data attached to that image.
#define LOG4CPP_INFO_S(logger)