1 #include "CallbackAddPointsInCurvesGraphs.h"
2 #include "CallbackCheckAddPointAxis.h"
3 #include "CallbackCheckEditPointAxis.h"
4 #include "CallbackNextOrdinal.h"
5 #include "CallbackRemovePointsInCurvesGraphs.h"
7 #include "CurvesGraphs.h"
8 #include "CurveStyles.h"
10 #include "DocumentSerialize.h"
11 #include "EngaugeAssert.h"
12 #include "EnumsToQt.h"
15 #include "OrdinalGenerator.h"
18 #include <QDataStream>
22 #include <QtToString.h>
23 #include <QXmlStreamReader>
24 #include <QXmlStreamWriter>
25 #include "SettingsForGraph.h"
26 #include "Transformation.h"
30 const int FOUR_BYTES = 4;
34 m_curveAxes (new
Curve (AXIS_CURVE_NAME,
39 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::Document"
40 <<
" image=" << image.width() <<
"x" << image.height();
42 m_successfulRead =
true;
44 m_pixmap.convertFromImage (image);
48 DEFAULT_GRAPH_CURVE_NAME);
59 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::Document"
60 <<
" fileName=" << fileName.toLatin1().data();
62 m_successfulRead =
true;
65 QFile *file =
new QFile (fileName);
66 if (file->open(QIODevice::ReadOnly)) {
68 QByteArray bytesStart = file->read (FOUR_BYTES);
71 if (bytesIndicatePreVersion6 (bytesStart)) {
73 QFile *file =
new QFile (fileName);
74 if (file->open (QIODevice::ReadOnly)) {
75 QDataStream str (file);
77 loadPreVersion6 (str);
81 m_successfulRead =
false;
82 m_reasonForUnsuccessfulRead =
"Operating system says file is not readable";
87 QFile *file =
new QFile (fileName);
88 if (file->open (QIODevice::ReadOnly | QIODevice::Text)) {
90 QXmlStreamReader reader (file);
92 loadPostVersion5 (reader);
101 m_successfulRead =
false;
102 m_reasonForUnsuccessfulRead =
"Operating system says file is not readable";
107 m_successfulRead =
false;
108 m_reasonForUnsuccessfulRead = QString (
"File '%1' was not found")
123 const QPointF &posGraph,
127 Point point (AXIS_CURVE_NAME,
135 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::addPointAxisWithGeneratedIdentifier"
136 <<
" ordinal=" << ordinal
137 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
138 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
139 <<
" identifier=" << identifier.toLatin1 ().data ();
143 const QPointF &posGraph,
144 const QString &identifier,
147 Point point (AXIS_CURVE_NAME,
154 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::addPointAxisWithSpecifiedIdentifier"
155 <<
" ordinal=" << ordinal
156 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
157 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
158 <<
" identifier=" << identifier.toLatin1 ().data ();
162 const QPointF &posScreen,
166 Point point (curveName,
173 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::addPointGraphWithGeneratedIdentifier"
174 <<
" ordinal=" << ordinal
175 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
176 <<
" identifier=" << identifier.toLatin1 ().data ();
180 const QPointF &posScreen,
181 const QString &identifier,
184 Point point (curveName,
190 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::addPointGraphWithSpecifiedIdentifier"
191 <<
" ordinal=" << ordinal
192 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
193 <<
" identifier=" << identifier.toLatin1 ().data ();
200 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
206 bool Document::bytesIndicatePreVersion6 (
const QByteArray &bytes)
const
208 QByteArray preVersion6MagicNumber;
209 preVersion6MagicNumber.resize (FOUR_BYTES);
210 preVersion6MagicNumber[0] = 0x00;
211 preVersion6MagicNumber[1] = 0x00;
212 preVersion6MagicNumber[2] = 0xCA;
213 preVersion6MagicNumber[3] = 0xFE;
215 return (bytes == preVersion6MagicNumber);
219 const QPointF &posGraph,
221 QString &errorMessage)
223 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::checkAddPointAxis"
224 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
225 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
231 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
240 const QPointF &posScreen,
241 const QPointF &posGraph,
243 QString &errorMessage)
245 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::checkEditPointAxis"
246 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
253 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
263 ENGAUGE_CHECK_PTR (m_curveAxes);
270 if (curveName == AXIS_CURVE_NAME) {
283 if (curveName == AXIS_CURVE_NAME) {
296 return m_curvesGraphs;
310 const QString &identifier)
312 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::editPointAxis posGraph=("
313 << posGraph.x () <<
", " << posGraph.y () <<
") identifier="
314 << identifier.toLatin1 ().data ();
320 void Document::generateEmptyPixmap(
const QXmlStreamAttributes &attributes)
322 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::generateEmptyPixmap";
324 int width = 800, height = 500;
326 if (attributes.hasAttribute (DOCUMENT_SERIALIZE_IMAGE_WIDTH) &&
327 attributes.hasAttribute (DOCUMENT_SERIALIZE_IMAGE_HEIGHT)) {
329 width = attributes.value (DOCUMENT_SERIALIZE_IMAGE_WIDTH).toInt();
330 height = attributes.value (DOCUMENT_SERIALIZE_IMAGE_HEIGHT).toInt();
334 m_pixmap = QPixmap (width, height);
339 ENGAUGE_CHECK_PTR (m_curveAxes);
346 ENGAUGE_CHECK_PTR (m_curveAxes);
352 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const
354 if (curveName == AXIS_CURVE_NAME) {
364 ENGAUGE_CHECK_PTR (m_curveAxes);
371 ENGAUGE_CHECK_PTR (m_curveAxes);
376 void Document::loadImage(QXmlStreamReader &reader)
378 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::loadImage";
380 loadNextFromReader(reader);
381 if (reader.isCDATA ()) {
384 QByteArray array64 = reader.text().toString().toUtf8();
388 array = QByteArray::fromBase64(array64);
391 QDataStream str (&array, QIODevice::ReadOnly);
392 QImage img = m_pixmap.toImage ();
394 m_pixmap = QPixmap::fromImage (img);
397 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
398 (reader.name() != DOCUMENT_SERIALIZE_IMAGE)){
399 loadNextFromReader(reader);
407 reader.raiseError (
"Cannot read image data");
411 void Document::loadPostVersion5 (QXmlStreamReader &reader)
413 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::loadPostVersion5";
417 bool inDocumentSubtree =
false;
420 while (!reader.atEnd() &&
421 !reader.hasError()) {
422 QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
425 if ((reader.name() == DOCUMENT_SERIALIZE_IMAGE) &&
426 (tokenType == QXmlStreamReader::StartElement)) {
428 generateEmptyPixmap (reader.attributes());
432 if ((reader.name() == DOCUMENT_SERIALIZE_DOCUMENT) &&
433 (tokenType == QXmlStreamReader::StartElement)) {
435 inDocumentSubtree =
true;
437 }
else if ((reader.name() == DOCUMENT_SERIALIZE_DOCUMENT) &&
438 (tokenType == QXmlStreamReader::EndElement)) {
444 if (inDocumentSubtree) {
447 if (tokenType == QXmlStreamReader::StartElement) {
450 QString tag = reader.name().toString();
451 if (tag == DOCUMENT_SERIALIZE_AXES_CHECKER){
452 m_modelAxesChecker.
loadXml (reader);
453 }
else if (tag == DOCUMENT_SERIALIZE_COORDS) {
454 m_modelCoords.
loadXml (reader);
455 }
else if (tag == DOCUMENT_SERIALIZE_CURVE) {
456 m_curveAxes =
new Curve (reader);
457 }
else if (tag == DOCUMENT_SERIALIZE_CURVES_GRAPHS) {
458 m_curvesGraphs.
loadXml (reader);
459 }
else if (tag == DOCUMENT_SERIALIZE_DIGITIZE_CURVE) {
460 m_modelDigitizeCurve.
loadXml (reader);
461 }
else if (tag == DOCUMENT_SERIALIZE_DOCUMENT) {
463 }
else if (tag == DOCUMENT_SERIALIZE_EXPORT) {
464 m_modelExport.
loadXml (reader);
465 }
else if (tag == DOCUMENT_SERIALIZE_GENERAL || tag == DOCUMENT_SERIALIZE_COMMON) {
466 m_modelGeneral.
loadXml (reader);
467 }
else if (tag == DOCUMENT_SERIALIZE_GRID_REMOVAL) {
468 m_modelGridRemoval.
loadXml (reader);
469 }
else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
472 }
else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
473 m_modelPointMatch.
loadXml (reader);
474 }
else if (tag == DOCUMENT_SERIALIZE_SEGMENTS) {
475 m_modelSegments.
loadXml (reader);
477 m_successfulRead =
false;
478 m_reasonForUnsuccessfulRead = QString (
"Unexpected xml token '%1' encountered").arg (tag);
484 if (reader.hasError ()) {
486 m_successfulRead =
false;
487 m_reasonForUnsuccessfulRead = reader.errorString();
493 void Document::loadPreVersion6 (QDataStream &str)
495 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::loadPreVersion6";
498 double dbl, versionDouble, radius = 0.0;
502 str >> versionDouble;
511 if (versionDouble >= 3) {
512 str >> (
double &) radius;
531 m_modelExport.
setHeader((ExportHeader) int32);
532 if (versionDouble >= 5.2) {
534 if (m_modelCoords.
coordsType() == COORDS_TYPE_CARTESIAN) {
538 if (m_modelCoords.
coordsType() == COORDS_TYPE_POLAR) {
572 if (versionDouble >= 5) {
610 if (versionDouble < 4) {
629 m_curveAxes =
new Curve (str);
630 Curve curveScale (str);
641 return m_modelAxesChecker;
654 return m_modelCoords;
667 return m_modelDigitizeCurve;
672 return m_modelExport;
677 return m_modelGeneral;
682 return m_modelGridRemoval;
687 return m_modelPointMatch;
692 return m_modelSegments;
696 const QPointF &deltaScreen)
709 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
712 if (curveName == AXIS_CURVE_NAME) {
745 QTextStream str (&text);
749 std::cerr << text.toLatin1().data();
753 QTextStream &str)
const
755 str << indentation <<
"Document\n";
757 indentation += INDENTATION_DELTA;
759 str << indentation <<
"name=" << m_name <<
"\n";
760 str << indentation <<
"pixmap=" << m_pixmap.width() <<
"x" << m_pixmap.height() <<
"\n";
787 ENGAUGE_ASSERT (!m_successfulRead);
789 return m_reasonForUnsuccessfulRead;
794 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::removePointAxis identifier=" << identifier.toLatin1 ().data ();
801 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::removePointGraph identifier=" << identifier.toLatin1 ().data ();
810 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
818 writer.writeStartElement(DOCUMENT_SERIALIZE_DOCUMENT);
822 writer.writeAttribute(DOCUMENT_SERIALIZE_APPLICATION_VERSION_NUMBER, VERSION_NUMBER);
826 QDataStream str (&array, QIODevice::WriteOnly);
827 QImage img = m_pixmap.toImage ();
829 writer.writeStartElement(DOCUMENT_SERIALIZE_IMAGE);
833 writer.writeAttribute(DOCUMENT_SERIALIZE_IMAGE_WIDTH, QString::number (img.width()));
834 writer.writeAttribute(DOCUMENT_SERIALIZE_IMAGE_HEIGHT, QString::number (img.height()));
836 writer.writeCDATA (array.toBase64 ());
837 writer.writeEndElement();
840 m_modelGeneral.
saveXml (writer);
841 m_modelCoords.
saveXml (writer);
842 m_modelDigitizeCurve.
saveXml (writer);
843 m_modelExport.
saveXml (writer);
844 m_modelAxesChecker.
saveXml (writer);
845 m_modelGridRemoval.
saveXml (writer);
846 m_modelPointMatch.
saveXml (writer);
847 m_modelSegments.
saveXml (writer);
849 m_curvesGraphs.
saveXml (writer);
850 writer.writeEndElement();
855 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::setCurvesGraphs";
868 ColorFilterSettingsList::const_iterator itr;
873 QString curveName = itr.key();
889 QStringList curveNames = modelCurveStyles.
curveNames();
890 QStringList::iterator itr;
891 for (itr = curveNames.begin(); itr != curveNames.end(); itr++) {
893 QString curveName = *itr;
933 return m_successfulRead;
938 LOG4CPP_INFO_S ((*mainCat)) <<
"Document::updatePointOrdinals";
void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
void addPointAxisWithSpecifiedIdentifier(const QPointF &posScreen, const QPointF &posGraph, const QString &identifier, double ordinal)
Add a single axis point with the specified point identifier.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
void removePoint(const QString &identifier)
Perform the opposite of addPointAtEnd.
QStringList curveNames() const
List of all curve names.
Manage storage and retrieval of the settings for the curves.
QPointF positionScreen(const QString &pointIdentifier) const
Return the position, in screen coordinates, of the specified Point.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...
void saveXml(QXmlStreamWriter &writer) const
Serialize curves.
QString errorMessage() const
Error message that explains the problem indicated by isError.
void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsPointMatch and CmdSettingsPointMatch.
Callback for computing the next ordinal for a new point.
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Callback that is used when iterating through a read-only CurvesGraphs to remove corresponding points ...
DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
void setCurveStyle(const CurveStyle &curveStyle)
Set curve style.
void setCloseDistance(double closeDistance)
Set method for close distance.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
void setLineColor(ColorPalette lineColor)
Set method for line color.
void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
void setCountX(int countX)
Set method for x count.
void setMinLength(double minLength)
Set method for min length.
void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void addPoint(Point point)
Add Point to this Curve.
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings)
Set color filter.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void setPaletteColorCandidate(ColorPalette paletteColorCandidate)
Set method for candidate color.
void iterateThroughCurveSegments(const QString &curveNameWanted, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to segments on the specified axis or graph Curve.
void setStopY(double stopY)
Set method for y stop.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for 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(...
int numCurves() const
Current number of graphs curves.
QString errorMessage() const
Error message that explains the problem indicated by isError.
int numPoints() const
Number of points.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void addPointGraphWithSpecifiedIdentifier(const QString &curveName, const QPointF &posScreen, const QString &identifier, double ordinal)
Add a single graph point with the specified point identifer. Note that PointStyle is not applied to t...
void setCoordScaleYRadius(CoordScale coordScale)
Set method for linear/log scale on y/radius.
Callback that is used when iterating through a read-only CurvesGraphs to add corresponding points in ...
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
const Curve & curveAxes() const
Get method for axis curve.
bool isError() const
True if an error occurred during iteration.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
void addGraphCurveAtEnd(Curve curve)
Append new graph Curve to end of Curve list.
void iterateThroughCurvesPoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
Apply functor to Points on all of the Curves.
void setStartY(double startY)
Set method for y start.
void setStepY(double stepY)
Set method for y step.
void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
QPixmap pixmap() const
Return the image that is being digitized.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
QPointF positionGraph(const QString &pointIdentifier) const
Return the position, in graph coordinates, of the specified Point.
bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
bool isError() const
True if an error occurred during iteration.
QString defaultCurveName(int indexOneBased, const QString &defaultName) const
Default graph name for the specified curve index.
void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
Callback for sanity checking the screen and graph coordinates of an axis point that is in the axes cu...
void setStartX(double startX)
Set method for x start.
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(...
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
void setLineWidth(double lineWidth)
Set method for line width.
void editPoint(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of an axis point. This method does not apply to a graph point...
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
QString identifier() const
Unique identifier for a specific Point.
void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
double nextOrdinal() const
Computed next ordinal.
void setCountY(int countY)
Set method for y count.
void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
Translate the position of a point by the specified distance vector.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void editPointAxis(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee suc...
Details for a specific Point.
void setStepX(double stepX)
Set method for x step.
void setMaxPointSize(double maxPointSize)
Set method for max point size.
void addPoint(const Point &point)
Append new Point to the specified Curve.
Container for all graph curves. The axes point curve is external to this class.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void iterateThroughCurvePoints(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to Points on Curve.
void setCoordUnitsTheta(CoordUnitsPolarTheta coordUnits)
Set method for theta units.
void setRemoveDefinedGridLines(bool removeDefinedGridLines)
Set method for removing defined grid lines.
CoordsType coordsType() const
Get method for coordinates type.
void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsCoords and CmdSettingsCoords.
int curvesGraphsNumPoints(const QString &curveName) const
Point count.
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
Container for LineStyle and PointStyle for one Curve.
void setOriginRadius(double originRadius)
Set method for origin radius in polar mode.
void setGridCoordDisableY(GridCoordDisable gridCoordDisable)
Set method for y coord parameter to disable.
Container for one set of digitized Points.
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals to be consistent with their CurveStyle and x/theta coordinate.
Details for a specific Line.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
void setCoordUnitsRadius(CoordUnitsNonPolarTheta coordUnits)
Set method for radius units.
void setGridCoordDisableX(GridCoordDisable gridCoordDisable)
Set method for x coord parameter to disable.
void setPaletteColorRejected(ColorPalette paletteColorRejected)
Set method for rejected color.
void addPointAxisWithGeneratedIdentifier(const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal)
Add a single axis point with a generated point identifier.
void print() const
Debugging method for printing directly from symbolic debugger.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsSegments and CmdSettingsSegments.
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
void loadPreVersion6(QDataStream &str)
Load from serialized binary pre-version 6 file.
void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs.
Callback for sanity checking the screen and graph coordinates of an axis point, before it is added to...
void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
QStringList curvesGraphsNames() const
List of graph curve names.
Document(const QImage &image)
Constructor for imported images and dragged images.
void removePoint(const QString &pointIdentifier)
Remove the Point from its Curve.
void saveXml(QXmlStreamWriter &writer) const
Save document to xml.
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
void iterateThroughCurveSegments(const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
Apply functor to successive Points, as line segments, on Curve. This could be a bit slow...
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
void saveXml(QXmlStreamWriter &writer) const
Serialize curve.
QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
void setPointSeparation(double pointSeparation)
Set method for point separation.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setPaletteColorAccepted(ColorPalette paletteColorAccepted)
Set method for accepted color.
void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
void setStopX(double stopX)
Set method for x stop.
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
void setCoordsType(CoordsType coordsType)
Set method for coordinates type.