14#include <QXmlStreamWriter>
27 m_fillCorners (false),
37 m_minLength (document.modelSegments().
minLength()),
38 m_fillCorners (document.modelSegments().
fillCorners()),
41 m_lineColor (document.modelSegments().
lineColor()),
77 return m_inactiveOpacity;
87 return m_lineWidthActive;
92 return m_lineWidthInactive;
101 QXmlStreamAttributes attributes = reader.attributes ();
147 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
150 if (reader.atEnd()) {
158 reader.raiseError(QObject::tr (
"Cannot read segment data"));
169 return m_pointSeparation;
173 QTextStream &str)
const
175 str << indentation <<
"DocumentModelSegments\n";
179 str << indentation <<
"pointSeparation=" << m_pointSeparation <<
"\n";
180 str << indentation <<
"minLength=" << m_minLength <<
"\n";
181 str << indentation <<
"fillCorners=" << (m_fillCorners ?
"true" :
"false") <<
"\n";
182 str << indentation <<
"lineWidthActive=" << m_lineWidthActive <<
"\n";
183 str << indentation <<
"lineWidthInactive=" << m_lineWidthInactive <<
"\n";
185 str << indentation <<
"inactiveOpacity=" << m_inactiveOpacity <<
"\n";
203 writer.writeEndElement();
QString colorPaletteToString(ColorPalette colorPalette)
const ColorPalette DEFAULT_LINE_COLOR
const double DEFAULT_LINE_WIDTH_ACTIVE
const double DEFAULT_LINE_WIDTH_INACTIVE
const double DEFAULT_MIN_LENGTH
const double DEFAULT_POINT_SEPARATION
const InactiveOpacity DEFAULT_INACTIVE_OPACITY
const QString DOCUMENT_SERIALIZE_SEGMENTS_MIN_LENGTH
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_WIDTH_INACTIVE
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_COLOR
const QString DOCUMENT_SERIALIZE_SEGMENTS_POINT_SEPARATION
const QString DOCUMENT_SERIALIZE_SEGMENTS
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_WIDTH
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_COLOR_STRING
const QString DOCUMENT_SERIALIZE_SEGMENTS_FILL_CORNERS
const QString DOCUMENT_SERIALIZE_SEGMENTS_LINE_WIDTH_ACTIVE
const QString DOCUMENT_SERIALIZE_SEGMENTS_INACTIVE_OPACITY
const QString DOCUMENT_SERIALIZE_BOOL_TRUE
const QString DOCUMENT_SERIALIZE_BOOL_FALSE
InactiveOpacity
Enum for opacity/alpha values used for segments that are not currently under hover.
log4cpp::Category * mainCat
const QString INDENTATION_DELTA
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
DocumentModelSegments()
Default constructor.
void setFillCorners(bool fillCorners)
Set method for fill corners.
void setLineWidthActive(double lineWidth)
Set method for line width when active.
double lineWidthInactive() const
Get method for line width when inactive.
double lineWidthActive() const
Get method for line width when active.
void setInactiveOpacity(InactiveOpacity inactiveOpacity)
Set method for inactive opacity.
void setPointSeparation(double pointSeparation)
Set method for point separation.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
InactiveOpacity inactiveOpacity() const
Get method for inactive opacity.
void setLineWidthInactive(double lineWidth)
Set method for line width when inactive.
DocumentModelSegments & operator=(const DocumentModelSegments &other)
Assignment constructor.
ColorPalette lineColor() const
Get method for line color.
double minLength() const
Get method for min length.
void setLineColor(ColorPalette lineColor)
Set method for line color.
bool fillCorners() const
Get method for fill corners.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
double pointSeparation() const
Get method for point separation.
void setMinLength(double minLength)
Set method for min length.
Storage of one imported image and the data attached to that image.
#define LOG4CPP_INFO_S(logger)