15#include <QXmlStreamReader>
16#include <QXmlStreamWriter>
19unsigned int Point::m_identifierIndex = 0;
36 m_identifier (uniqueIdentifierGenerator(curveName)),
37 m_posScreen (posScreen),
38 m_hasPosGraph (
false),
45 <<
" curveName=" << curveName.toLatin1().data()
46 <<
" identifierGenerated=" << m_identifier.toLatin1().data()
57 m_identifier (uniqueIdentifierGenerator(curveName)),
58 m_posScreen (posScreen),
60 m_posGraph (posGraph),
69 <<
" curveName=" << curveName.toLatin1().data()
70 <<
" identifierGenerated=" << m_identifier.toLatin1().data()
73 <<
" isXOnly=" << (
isXOnly ?
"true" :
"false");
85 m_identifier (identifier),
86 m_posScreen (posScreen),
88 m_posGraph (posGraph),
96 <<
" curveName=" << curveName.toLatin1().data()
97 <<
" identifier=" << m_identifier.toLatin1().data()
101 <<
" isXOnly=" << (
isXOnly ?
"true" :
"false");
111 m_isAxisPoint (
true),
112 m_identifier (uniqueIdentifierGenerator(curveName)),
113 m_posScreen (posScreen),
114 m_hasPosGraph (
true),
115 m_posGraph (posGraph),
123 <<
" curveName=" << curveName.toLatin1().data()
124 <<
" identifierGenerated=" << m_identifier.toLatin1().data()
128 <<
" isXOnly=" << (
isXOnly ?
"true" :
"false");
137 m_isAxisPoint (
false),
138 m_identifier (identifier),
139 m_posScreen (posScreen),
140 m_hasPosGraph (
false),
149 <<
" curveName=" << curveName.toLatin1().data()
150 <<
" identifier=" <<
identifier.toLatin1().data()
160 m_isAxisPoint (
false),
161 m_identifier (uniqueIdentifierGenerator(curveName)),
162 m_posScreen (posScreen),
163 m_hasPosGraph (
false),
172 <<
" identifierGenerated=" << m_identifier.toLatin1().data()
185 <<
" isAxisPoint=" << (
other.isAxisPoint() ?
"true" :
"false")
186 <<
" identifier=" <<
other.identifier ().toLatin1().data()
188 <<
" hasPosGraph=" << (
other.hasPosGraph() ?
"true" :
"false")
190 <<
" hasOrdinal=" << (
other.hasOrdinal() ?
"true" :
"false")
192 <<
" isXOnly=" <<
other.isXOnly ();
194 m_isAxisPoint =
other.isAxisPoint ();
195 m_identifier =
other.identifier ();
196 m_posScreen =
other.posScreen ();
197 m_hasPosGraph =
other.hasPosGraph ();
199 m_hasOrdinal =
other.hasOrdinal ();
201 m_isXOnly =
other.isXOnly ();
207 <<
" isAxisPoint=" << (point.
isAxisPoint() ?
"true" :
"false")
208 <<
" identifier=" << point.
identifier ().toLatin1().data()
210 <<
" hasPosGraph=" << (point.
hasPosGraph() ?
"true" :
"false")
212 <<
" hasOrdinal=" << (point.
hasOrdinal() ?
"true" :
"false")
265 return m_hasPosGraph;
276 <<
" identifierIndex=" << m_identifierIndex;
278 return m_identifierIndex;
283 return m_isAxisPoint;
321 m_hasPosGraph =
false;
326 while ((
reader.tokenType() != QXmlStreamReader::EndElement) ||
335 if (
reader.tokenType () == QXmlStreamReader::StartElement) {
353 m_hasPosGraph =
true;
371 <<
" identifier=" << m_identifier.toLatin1().data()
372 <<
" identifierIndex=" << m_identifierIndex
375 <<
" ordinal=" << m_ordinal;
382 reader.raiseError(QObject::tr (
"Cannot read point data"));
489 <<
" identifier=" << m_identifier.toLatin1().data()
499 <<
" identifier=" << m_identifier.toLatin1().data()
506 m_hasPosGraph =
true;
513 <<
" identifier=" << m_identifier.toLatin1().data()
527QString Point::uniqueIdentifierGenerator (
const QString &curveName)
530 <<
" curveName=" << curveName.toLatin1().data()
531 <<
" identifierIndex=" << m_identifierIndex;
533 return QString (
"%1%2point%3%4")
537 .arg (m_identifierIndex++);
const QString AXIS_CURVE_NAME
const QString DUMMY_CURVE_NAME
const int INNER_RADIUS_MIN
const QString DOCUMENT_SERIALIZE_POINT_POSITION_GRAPH
const QString DOCUMENT_SERIALIZE_POINT_Y
const QString DOCUMENT_SERIALIZE_POINT_IDENTIFIER
const QString DOCUMENT_SERIALIZE_POINT_POSITION_SCREEN
const QString DOCUMENT_SERIALIZE_POINT_IS_AXIS_POINT
const QString DOCUMENT_SERIALIZE_POINT
const QString DOCUMENT_SERIALIZE_POINT_X
const QString DOCUMENT_SERIALIZE_POINT_ORDINAL
const QString DOCUMENT_SERIALIZE_POINT_IS_X_ONLY
const QString DOCUMENT_SERIALIZE_BOOL_TRUE
const QString DOCUMENT_SERIALIZE_BOOL_FALSE
const QString DOCUMENT_SERIALIZE_POINT_IDENTIFIER_INDEX
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
log4cpp::Category * mainCat
const QString INDENTATION_DELTA
const QString AXIS_CURVE_NAME
const QString POINT_IDENTIFIER_DELIMITER_XML("_")
const double MISSING_ORDINAL_VALUE
const QString DUMMY_CURVE_NAME
const double MISSING_POSGRAPH_VALUE
const QString POINT_IDENTIFIER_DELIMITER_SAFE
QString QPointFToString(const QPointF &pos)
QXmlStreamReader::TokenType loadNextFromReader(QXmlStreamReader &reader)
Load next token from xml reader.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
void setOrdinal(double ordinal)
Set the ordinal used for ordering Points.
void setCurveName(const QString &curveName)
Update the point identifer to match the specified curve name.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setPosScreen(const QPointF &posScreen)
Set method for position in screen coordinates.
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...
bool hasPosGraph() const
True if graph position is defined.
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
static unsigned int identifierIndex()
Return the current index for storage in case we need to reset it later while performing a Redo.
QPointF posScreen() const
Accessor for screen position.
QString identifier() const
Unique identifier for a specific Point.
static void setIdentifierIndex(unsigned int identifierIndex)
Reset the current index while performing a Redo.
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
void setPosGraph(const QPointF &posGraph)
Set method for position in graph coordinates.
bool hasOrdinal() const
True if ordinal is defined.
Point & operator=(const Point &point)
Assignment constructor.
static QString temporaryPointIdentifier()
Point identifier for temporary point that is used by DigitzeStateAxis.
bool isAxisPoint() const
True if point is an axis point. This is used only for sanity checks.
Point()
Default constructor so this class can be used inside a container.
bool isXOnly() const
In DOCUMENT_AXES_POINTS_REQUIRED_4 modes, this is true/false if y/x coordinate is undefined.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)