7 #include "CallbackAddPointsInCurvesGraphs.h"
8 #include "CallbackCheckAddPointAxis.h"
9 #include "CallbackCheckEditPointAxis.h"
10 #include "CallbackNextOrdinal.h"
11 #include "CallbackRemovePointsInCurvesGraphs.h"
12 #include "CoordSystem.h"
14 #include "CurvesGraphs.h"
15 #include "CurveStyles.h"
16 #include "DocumentSerialize.h"
17 #include "EngaugeAssert.h"
18 #include "EnumsToQt.h"
21 #include "OrdinalGenerator.h"
24 #include <QDataStream>
28 #include <QtToString.h>
29 #include <QXmlStreamReader>
30 #include <QXmlStreamWriter>
31 #include "SettingsForGraph.h"
32 #include "Transformation.h"
36 const int FOUR_BYTES = 4;
39 m_curveAxes (new
Curve (AXIS_CURVE_NAME,
43 m_documentAxesPointsRequired (documentAxesPointsRequired)
45 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::CoordSystem";
49 DEFAULT_GRAPH_CURVE_NAME);
55 resetSelectedCurveNameIfNecessary ();
65 resetSelectedCurveNameIfNecessary ();
69 const QPointF &posGraph,
74 Point point (AXIS_CURVE_NAME,
83 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::addPointAxisWithGeneratedIdentifier"
84 <<
" ordinal=" << ordinal
85 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
86 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
87 <<
" identifier=" << identifier.toLatin1 ().data ();
91 const QPointF &posGraph,
92 const QString &identifier,
96 Point point (AXIS_CURVE_NAME,
104 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::addPointAxisWithSpecifiedIdentifier"
105 <<
" ordinal=" << ordinal
106 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
107 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ()
108 <<
" identifier=" << identifier.toLatin1 ().data ();
112 const QPointF &posScreen,
116 Point point (curveName,
123 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::addPointGraphWithGeneratedIdentifier"
124 <<
" ordinal=" << ordinal
125 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
126 <<
" identifier=" << identifier.toLatin1 ().data ();
130 const QPointF &posScreen,
131 const QString &identifier,
134 Point point (curveName,
140 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::addPointGraphWithSpecifiedIdentifier"
141 <<
" ordinal=" << ordinal
142 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
143 <<
" identifier=" << identifier.toLatin1 ().data ();
150 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
156 bool CoordSystem::bytesIndicatePreVersion6 (
const QByteArray &bytes)
const
158 QByteArray preVersion6MagicNumber;
159 preVersion6MagicNumber.resize (FOUR_BYTES);
162 preVersion6MagicNumber[0] =
'\x00';
163 preVersion6MagicNumber[1] =
'\x00';
164 preVersion6MagicNumber[2] =
'\xCA';
165 preVersion6MagicNumber[3] =
'\xFE';
167 return (bytes == preVersion6MagicNumber);
171 const QPointF &posGraph,
173 QString &errorMessage,
176 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::checkAddPointAxis"
177 <<
" posScreen=" << QPointFToString (posScreen).toLatin1 ().data ()
178 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
183 m_documentAxesPointsRequired,
186 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
195 const QPointF &posScreen,
196 const QPointF &posGraph,
198 QString &errorMessage)
200 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::checkEditPointAxis"
201 <<
" posGraph=" << QPointFToString (posGraph).toLatin1 ().data ();
207 m_documentAxesPointsRequired);
209 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
219 ENGAUGE_CHECK_PTR (m_curveAxes);
226 if (curveName == AXIS_CURVE_NAME) {
239 if (curveName == AXIS_CURVE_NAME) {
252 return m_curvesGraphs;
266 const QString &identifier)
268 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::editPointAxis posGraph=("
269 << posGraph.x () <<
", " << posGraph.y () <<
") identifier="
270 << identifier.toLatin1 ().data ();
278 return m_curveAxes->
isXOnly (pointIdentifier);
283 ENGAUGE_CHECK_PTR (m_curveAxes);
290 ENGAUGE_CHECK_PTR (m_curveAxes);
296 const Functor2wRet<const Point &, const Point &, CallbackSearchReturn> &ftorWithCallback)
const
298 if (curveName == AXIS_CURVE_NAME) {
308 ENGAUGE_CHECK_PTR (m_curveAxes);
315 ENGAUGE_CHECK_PTR (m_curveAxes);
322 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::loadCurvesFile";
330 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::loadPreVersion6";
333 double dbl, radius = 0.0;
336 m_documentAxesPointsRequired = DOCUMENT_AXES_POINTS_REQUIRED_3;
343 str >> (
double &) radius;
362 m_modelExport.
setHeader((ExportHeader) int32);
363 if (version >= 5.1) {
365 if (m_modelCoords.
coordsType() == COORDS_TYPE_CARTESIAN) {
369 if (m_modelCoords.
coordsType() == COORDS_TYPE_POLAR) {
420 m_modelGridDisplay.
setDisableX((GridCoordDisable) int32);
422 m_modelGridDisplay.
setDisableY((GridCoordDisable) int32);
471 m_curveAxes =
new Curve (str);
472 Curve curveScale (str);
480 resetSelectedCurveNameIfNecessary ();
485 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::loadVersion6";
487 m_documentAxesPointsRequired = DOCUMENT_AXES_POINTS_REQUIRED_3;
490 while (!reader.atEnd() &&
491 !reader.hasError()) {
492 QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
494 if ((reader.name() == DOCUMENT_SERIALIZE_DOCUMENT) &&
495 (tokenType == QXmlStreamReader::EndElement)) {
502 if (tokenType == QXmlStreamReader::StartElement) {
505 QString tag = reader.name().toString();
506 if (tag == DOCUMENT_SERIALIZE_AXES_CHECKER){
507 m_modelAxesChecker.
loadXml (reader);
508 }
else if (tag == DOCUMENT_SERIALIZE_COORDS) {
509 m_modelCoords.
loadXml (reader);
510 }
else if (tag == DOCUMENT_SERIALIZE_CURVE) {
511 m_curveAxes =
new Curve (reader);
512 }
else if (tag == DOCUMENT_SERIALIZE_CURVES_GRAPHS) {
513 m_curvesGraphs.
loadXml (reader);
514 }
else if (tag == DOCUMENT_SERIALIZE_DIGITIZE_CURVE) {
515 m_modelDigitizeCurve.
loadXml (reader);
516 }
else if (tag == DOCUMENT_SERIALIZE_EXPORT) {
517 m_modelExport.
loadXml (reader);
518 }
else if (tag == DOCUMENT_SERIALIZE_GENERAL || tag == DOCUMENT_SERIALIZE_COMMON) {
519 m_modelGeneral.
loadXml (reader);
520 }
else if (tag == DOCUMENT_SERIALIZE_GRID_REMOVAL) {
521 m_modelGridRemoval.
loadXml (reader);
522 }
else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
523 ENGAUGE_ASSERT (
false);
524 }
else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
525 m_modelPointMatch.
loadXml (reader);
526 }
else if (tag == DOCUMENT_SERIALIZE_SEGMENTS) {
527 m_modelSegments.
loadXml (reader);
529 m_successfulRead =
false;
530 m_reasonForUnsuccessfulRead = QString (
"%1 '%2' %3")
531 .arg (QObject::tr (
"Unexpected xml token"))
533 .arg (
"encountered");
539 resetSelectedCurveNameIfNecessary ();
543 DocumentAxesPointsRequired documentAxesPointsRequired)
545 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::loadVersions7AndUp";
547 m_documentAxesPointsRequired = documentAxesPointsRequired;
550 while (!reader.atEnd() &&
551 !reader.hasError()) {
552 QXmlStreamReader::TokenType tokenType = loadNextFromReader(reader);
554 if ((reader.name() == DOCUMENT_SERIALIZE_COORD_SYSTEM) &&
555 (tokenType == QXmlStreamReader::EndElement)) {
562 if (tokenType == QXmlStreamReader::StartElement) {
565 QString tag = reader.name().toString();
566 if (tag == DOCUMENT_SERIALIZE_AXES_CHECKER){
567 m_modelAxesChecker.
loadXml (reader);
568 }
else if (tag == DOCUMENT_SERIALIZE_COORDS) {
569 m_modelCoords.
loadXml (reader);
570 }
else if (tag == DOCUMENT_SERIALIZE_CURVE) {
571 m_curveAxes =
new Curve (reader);
572 }
else if (tag == DOCUMENT_SERIALIZE_CURVES_GRAPHS) {
573 m_curvesGraphs.
loadXml (reader);
574 }
else if (tag == DOCUMENT_SERIALIZE_DIGITIZE_CURVE) {
575 m_modelDigitizeCurve.
loadXml (reader);
576 }
else if (tag == DOCUMENT_SERIALIZE_EXPORT) {
577 m_modelExport.
loadXml (reader);
578 }
else if (tag == DOCUMENT_SERIALIZE_GENERAL || tag == DOCUMENT_SERIALIZE_COMMON) {
579 m_modelGeneral.
loadXml (reader);
580 }
else if (tag == DOCUMENT_SERIALIZE_GRID_DISPLAY) {
581 m_modelGridDisplay.
loadXml (reader);
582 }
else if (tag == DOCUMENT_SERIALIZE_GRID_REMOVAL) {
583 m_modelGridRemoval.
loadXml (reader);
584 }
else if (tag == DOCUMENT_SERIALIZE_IMAGE) {
585 ENGAUGE_ASSERT (
false);
586 }
else if (tag == DOCUMENT_SERIALIZE_POINT_MATCH) {
587 m_modelPointMatch.
loadXml (reader);
588 }
else if (tag == DOCUMENT_SERIALIZE_SEGMENTS) {
589 m_modelSegments.
loadXml (reader);
591 m_successfulRead =
false;
592 m_reasonForUnsuccessfulRead = QString (
"Unexpected xml token '%1' encountered").arg (tag);
598 resetSelectedCurveNameIfNecessary ();
603 return m_modelAxesChecker;
616 return m_modelCoords;
629 return m_modelDigitizeCurve;
634 return m_modelExport;
639 return m_modelGeneral;
644 return m_modelGridDisplay;
649 return m_modelGridRemoval;
654 return m_modelPointMatch;
659 return m_modelSegments;
663 const QPointF &deltaScreen)
668 ENGAUGE_ASSERT (curve != 0);
677 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
680 if (curveName == AXIS_CURVE_NAME) {
708 QTextStream str (&text);
712 std::cerr << text.toLatin1().data();
716 QTextStream &str)
const
718 str << indentation <<
"Graph\n";
720 indentation += INDENTATION_DELTA;
752 ENGAUGE_ASSERT (!m_successfulRead);
754 return m_reasonForUnsuccessfulRead;
759 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::removePointAxis identifier=" << identifier.toLatin1 ().data ();
766 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::removePointGraph identifier=" << identifier.toLatin1 ().data ();
775 Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
781 void CoordSystem::resetSelectedCurveNameIfNecessary ()
783 if (m_selectedCurveName.isEmpty () ||
794 writer.writeStartElement(DOCUMENT_SERIALIZE_COORD_SYSTEM);
797 m_modelGeneral.
saveXml (writer);
798 m_modelCoords.
saveXml (writer);
799 m_modelDigitizeCurve.
saveXml (writer);
800 m_modelExport.
saveXml (writer);
801 m_modelAxesChecker.
saveXml (writer);
802 m_modelGridDisplay.
saveXml (writer);
803 m_modelGridRemoval.
saveXml (writer);
804 m_modelPointMatch.
saveXml (writer);
805 m_modelSegments.
saveXml (writer);
807 m_curvesGraphs.
saveXml (writer);
808 writer.writeEndElement();
813 return m_selectedCurveName;
818 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::setCurveAxes";
820 if (m_curveAxes != 0) {
825 m_curveAxes =
new Curve (curveAxes);
830 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::setCurvesGraphs";
834 resetSelectedCurveNameIfNecessary ();
845 ColorFilterSettingsList::const_iterator itr;
850 QString curveName = itr.key();
866 QStringList curveNames = modelCurveStyles.
curveNames();
867 QStringList::iterator itr;
868 for (itr = curveNames.begin(); itr != curveNames.end(); itr++) {
870 QString curveName = *itr;
920 return m_successfulRead;
925 LOG4CPP_INFO_S ((*mainCat)) <<
"CoordSystem::updatePointOrdinals";
void loadVersion6(QXmlStreamReader &reader)
Load from file in version 6 format.
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
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 setStartX(double startX)
Set method for x grid line lower bound (inclusive).
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...
virtual QString reasonForUnsuccessfulRead() const
Return an informative text message explaining why startup loading failed. Applies if successfulRead r...
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void loadXml(QXmlStreamReader &reader)
Load from serialized xml post-version 5 file.
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
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 ...
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual 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 setLineColor(ColorPalette lineColor)
Set method for line color.
void setCountY(unsigned int countY)
Set method for y grid line count.
void setStepX(double stepX)
Set method for x grid line increment.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
void setCountX(int countX)
Set method for x count.
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
void setMinLength(double minLength)
Set method for min length.
void loadPreVersion6(QDataStream &str, double version)
Load from file in pre-version 6 format.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void addPoint(Point point)
Add Point to this Curve.
virtual void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
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.
virtual void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
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(...
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
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 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 ...
virtual bool successfulRead() const
Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will ex...
virtual void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.
virtual void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
bool isError() const
True if an error occurred during iteration.
bool isXOnly(const QString &pointIdentifier) const
Determine if specified point has just x coordinate. Otherwise has just y coordinate, or both x and y coordinates.
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.
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
void setStepY(double yStep)
Set method for y grid line increment.
QPointF positionGraph(const QString &pointIdentifier) const
Return the position, in graph coordinates, of the specified Point.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
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.
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.
virtual void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
virtual void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
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 loadVersions7AndUp(QXmlStreamReader &reader, DocumentAxesPointsRequired documentAxesPointsRequired)
Load from file in versions 7 and 8 formats.
virtual void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
virtual void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
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.
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void setStable(bool stable)
Set method for stable flag.
virtual void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs. Applies to current coordinate system.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
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 print() const
Debugging method for printing directly from symbolic debugger.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve. Applies to current coordinate system.
void setStopX(double stopX)
Set method for x grid line upper bound (inclusive).
virtual int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
virtual void addPointAxisWithSpecifiedIdentifier(const QPointF &posScreen, const QPointF &posGraph, const QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with the specified point identifier.
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 removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
bool isXOnly(const QString &pointIdentifier) const
Return true if y coordinate is undefined, otherwise x coordinae is undefined in DOCUMENT_AXES_POINT_R...
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
virtual const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
virtual void setModelColorFilter(const DocumentModelColorFilter &modelColorFilter)
Set method for DocumentModelColorFilter.
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.
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
virtual void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
CoordsType coordsType() const
Get method for coordinates type.
void setDisableX(GridCoordDisable disableX)
Set method for x grid line disabled variable.
void setStopY(double yStop)
Set method for y grid line upper bound (inclusive).
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsCoords and CmdSettingsCoords.
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
int curvesGraphsNumPoints(const QString &curveName) const
Point count.
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.
void setDisableY(GridCoordDisable disableY)
Set method for y grid line disabled variable.
virtual const Curve & curveAxes() const
Get method for axis curve.
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.
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
virtual void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
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.
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
void setCountX(unsigned int countX)
Set method for x grid line count.
virtual QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
void setStartY(double yStart)
Set method for y grid line lower bound (inclusive).
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
virtual void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
virtual bool loadCurvesFile(const QString &curvesFile)
Load the curve names in the specified Engauge file into the current graph. This is called near the en...
virtual 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...
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
virtual void addPointAxisWithGeneratedIdentifier(const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal, bool isXOnly)
Add a single axis point with a generated point identifier.
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
virtual void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
virtual void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
Model for DlgSettingsSegments and CmdSettingsSegments.
void loadPreVersion6(QDataStream &str)
Load from serialized binary pre-version 6 file.
Callback for sanity checking the screen and graph coordinates of an axis point, before it is added to...
virtual void editPointAxis(const QPointF &posGraph, const QString &identifier)
Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee suc...
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
QStringList curvesGraphsNames() const
List of graph curve names.
virtual void setModelCurveStyles(const CurveStyles &modelCurveStyles)
Set method for CurveStyles.
virtual void setSelectedCurveName(const QString &selectedCurveName)
Save curve name that is selected for the current coordinate system, for the next time the coordinate ...
void removePoint(const QString &pointIdentifier)
Remove the Point from its Curve.
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
virtual void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
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.
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.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
CoordSystem(DocumentAxesPointsRequired documentAxesPointsRequired)
Single constructor.
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 setStopX(double stopX)
Set method for x stop.
virtual void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
virtual void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
void setCoordsType(CoordsType coordsType)
Set method for coordinates type.