Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Document Class Reference

Storage of one imported image and the data attached to that image. More...

#include <Document.h>

Collaboration diagram for Document:
Collaboration graph

Public Member Functions

 Document (const QImage &image)
 Constructor for imported images and dragged images. Only one coordinate system is create - others are added later externally. More...
 
 Document (const QString &fileName)
 Constructor for opened Documents, and error report files. The specified file is opened and read. More...
 
void addCoordSystems (unsigned int numberCoordSystemToAdd)
 Add some number (0 or more) of additional coordinate systems. More...
 
void addGraphCurveAtEnd (const QString &curveName)
 Add new graph curve to the list of existing graph curves. More...
 
void addPointAxisWithGeneratedIdentifier (const QPointF &posScreen, const QPointF &posGraph, QString &identifier, double ordinal, bool isXOnly)
 Add a single axis point with a generated point identifier. More...
 
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. More...
 
void addPointGraphWithGeneratedIdentifier (const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
 Add a single graph point with a generated point identifier. More...
 
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 the point within the Document. More...
 
void addPointsInCurvesGraphs (CurvesGraphs &curvesGraphs)
 Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs. More...
 
void addScaleWithGeneratedIdentifier (const QPointF &posScreen0, const QPointF &posScreen1, double scaleLength, QString &identifier0, QString &identifier1, double ordinal0, double ordinal1)
 Add scale with a generated point identifier. More...
 
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) More...
 
void checkEditPointAxis (const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
 Check before calling editPointAxis. More...
 
const CoordSystemcoordSystem () const
 Currently active CoordSystem. More...
 
unsigned int coordSystemCount () const
 Number of CoordSystem. More...
 
CoordSystemIndex coordSystemIndex () const
 Index of current active CoordSystem. More...
 
const CurvecurveAxes () const
 Get method for axis curve. More...
 
const CurvecurveForCurveName (const QString &curveName) const
 See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME. More...
 
const CurvesGraphscurvesGraphs () const
 Make all Curves available, read only, for CmdAbstract classes only. More...
 
QStringList curvesGraphsNames () const
 See CurvesGraphs::curvesGraphsNames. More...
 
int curvesGraphsNumPoints (const QString &curveName) const
 See CurvesGraphs::curvesGraphsNumPoints. More...
 
DocumentAxesPointsRequired documentAxesPointsRequired () const
 Get method for DocumentAxesPointsRequired. More...
 
void editPointAxis (const QPointF &posGraph, const QString &identifier)
 Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee success in this call. More...
 
void editPointGraph (bool isX, bool isY, double x, double y, const QStringList &identifiers, const Transformation &transformation)
 Edit the graph coordinates of one or more graph points. More...
 
void initializeGridDisplay (const Transformation &transformation)
 Initialize grid display. This is called immediately after the transformation has been defined for the first time. More...
 
bool isXOnly (const QString &pointIdentifier) const
 See Curve::isXOnly. More...
 
void iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
 See Curve::iterateThroughCurvePoints, for the axes curve. More...
 
void iterateThroughCurvePointsAxes (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurvePoints, for the axes curve. More...
 
void iterateThroughCurveSegments (const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurveSegments, for any axes or graph curve. More...
 
void iterateThroughCurvesPointsGraphs (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
 See Curve::iterateThroughCurvePoints, for all the graphs curves. More...
 
void iterateThroughCurvesPointsGraphs (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
 See Curve::iterateThroughCurvePoints, for all the graphs curves. More...
 
bool loadCurvesFile (const QString &curvesFile)
 Load the curve names in the specified Engauge file into the current document. This is called near the end of the import process only. More...
 
DocumentModelAxesChecker modelAxesChecker () const
 Get method for DocumentModelAxesChecker. More...
 
DocumentModelColorFilter modelColorFilter () const
 Get method for DocumentModelColorFilter. More...
 
DocumentModelCoords modelCoords () const
 Get method for DocumentModelCoords. More...
 
CurveStyles modelCurveStyles () const
 Get method for CurveStyles. More...
 
DocumentModelDigitizeCurve modelDigitizeCurve () const
 Get method for DocumentModelDigitizeCurve. More...
 
DocumentModelExportFormat modelExport () const
 Get method for DocumentModelExportFormat. More...
 
DocumentModelGeneral modelGeneral () const
 Get method for DocumentModelGeneral. More...
 
DocumentModelGridDisplay modelGridDisplay () const
 Get method for DocumentModelGridDisplay. More...
 
DocumentModelGridRemoval modelGridRemoval () const
 Get method for DocumentModelGridRemoval. More...
 
DocumentModelPointMatch modelPointMatch () const
 Get method for DocumentModelPointMatch. More...
 
DocumentModelSegments modelSegments () const
 Get method for DocumentModelSegments. More...
 
void movePoint (const QString &pointIdentifier, const QPointF &deltaScreen)
 See Curve::movePoint. More...
 
int nextOrdinalForCurve (const QString &curveName) const
 Default next ordinal value for specified curve. More...
 
QPixmap pixmap () const
 Return the image that is being digitized. More...
 
QPointF positionGraph (const QString &pointIdentifier) const
 See Curve::positionGraph. More...
 
QPointF positionScreen (const QString &pointIdentifier) const
 See Curve::positionScreen. More...
 
void print () const
 Debugging method for printing directly from symbolic debugger. More...
 
void printStream (QString indentation, QTextStream &str) const
 Debugging method that supports print method of this class and printStream method of some other class(es) More...
 
QString reasonForUnsuccessfulRead () const
 Return an informative text message explaining why startup loading failed. Applies if successfulRead returns false. More...
 
void removePointAxis (const QString &identifier)
 Perform the opposite of addPointAxis. More...
 
void removePointGraph (const QString &identifier)
 Perform the opposite of addPointGraph. More...
 
void removePointsInCurvesGraphs (CurvesGraphs &curvesGraphs)
 Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs. More...
 
void saveXml (QXmlStreamWriter &writer) const
 Save document to xml. More...
 
QString selectedCurveName () const
 Currently selected curve name. This is used to set the selected curve combobox in MainWindow. More...
 
void setCoordSystemIndex (CoordSystemIndex coordSystemIndex)
 Set the index of current active CoordSystem. More...
 
void setCurveAxes (const Curve &curveAxes)
 Let CmdAbstract classes overwrite axes Curve. More...
 
void setCurvesGraphs (const CurvesGraphs &curvesGraphs)
 Let CmdAbstract classes overwrite CurvesGraphs. More...
 
void setDocumentAxesPointsRequired (DocumentAxesPointsRequired documentAxesPointsRequired)
 Set the number of axes points required. More...
 
void setModelAxesChecker (const DocumentModelAxesChecker &modelAxesChecker)
 Set method for DocumentModelAxesChecker. More...
 
void setModelColorFilter (const DocumentModelColorFilter &modelColorFilter)
 Set method for DocumentModelColorFilter. More...
 
void setModelCoords (const DocumentModelCoords &modelCoords)
 Set method for DocumentModelCoords. More...
 
void setModelCurveStyles (const CurveStyles &modelCurveStyles)
 Set method for CurveStyles. More...
 
void setModelDigitizeCurve (const DocumentModelDigitizeCurve &modelDigitizeCurve)
 Set method for DocumentModelDigitizeCurve. More...
 
void setModelExport (const DocumentModelExportFormat &modelExport)
 Set method for DocumentModelExportFormat. More...
 
void setModelGeneral (const DocumentModelGeneral &modelGeneral)
 Set method for DocumentModelGeneral. More...
 
void setModelGridDisplay (const DocumentModelGridDisplay &modelGridDisplay)
 Set method for DocumentModelGridDisplay. More...
 
void setModelGridRemoval (const DocumentModelGridRemoval &modelGridRemoval)
 Set method for DocumentModelGridRemoval. More...
 
void setModelPointMatch (const DocumentModelPointMatch &modelPointMatch)
 Set method for DocumentModelPointMatch. More...
 
void setModelSegments (const DocumentModelSegments &modelSegments)
 Set method for DocumentModelSegments. More...
 
void setPixmap (const QImage &image)
 Set method for the background pixmap. More...
 
void setSelectedCurveName (const QString &selectedCurveName)
 Save curve name that is selected for the current coordinate system, for the next time the coordinate system reappears. More...
 
bool successfulRead () const
 Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will explain why. More...
 
void updatePointOrdinals (const Transformation &transformation)
 Update point ordinals after point addition/removal or dragging. More...
 

Detailed Description

Storage of one imported image and the data attached to that image.

Definition at line 41 of file Document.h.

Constructor & Destructor Documentation

Document::Document ( const QImage &  image)

Constructor for imported images and dragged images. Only one coordinate system is create - others are added later externally.

Definition at line 53 of file Document.cpp.

53  :
54  m_name ("untitled"),
55  m_documentAxesPointsRequired (DOCUMENT_AXES_POINTS_REQUIRED_3)
56 {
57  LOG4CPP_INFO_S ((*mainCat)) << "Document::Document"
58  << " image=" << image.width() << "x" << image.height();
59 
60  m_coordSystemContext.addCoordSystems(NOMINAL_COORD_SYSTEM_COUNT);
61 
62  m_successfulRead = true; // Reading from QImage always succeeds, resulting in empty Document
63 
64  m_pixmap.convertFromImage (image);
65 }
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
const int NOMINAL_COORD_SYSTEM_COUNT
Definition: Document.cpp:44
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Document::Document ( const QString &  fileName)

Constructor for opened Documents, and error report files. The specified file is opened and read.

Definition at line 67 of file Document.cpp.

67  :
68  m_name (fileName),
69  m_documentAxesPointsRequired (DOCUMENT_AXES_POINTS_REQUIRED_3)
70 {
71  LOG4CPP_INFO_S ((*mainCat)) << "Document::Document"
72  << " fileName=" << fileName.toLatin1().data();
73 
74  m_successfulRead = true;
75 
76  // Grab first few bytes to determine the version number
77  QFile fileVersion (fileName);
78  if (fileVersion.open(QIODevice::ReadOnly)) {
79 
80  QByteArray bytesStart = fileVersion.read (FOUR_BYTES);
81  fileVersion.close ();
82 
83  if (bytesIndicatePreVersion6 (bytesStart)) {
84 
85  QFile *file = new QFile (fileName);
86  if (file->open (QIODevice::ReadOnly)) {
87  QDataStream str (file);
88 
89  m_coordSystemContext.addCoordSystems(NOMINAL_COORD_SYSTEM_COUNT);
90  loadPreVersion6 (str);
91 
92  } else {
93 
94  m_successfulRead = false;
95  m_reasonForUnsuccessfulRead = QObject::tr ("Operating system says file is not readable");
96 
97  }
98  } else {
99 
100  QFile *file = new QFile (fileName);
101  if (file->open (QIODevice::ReadOnly | QIODevice::Text)) {
102 
103  int version = versionFromFile (file);
104  switch (version)
105  {
106  case VERSION_6:
107  loadVersion6 (file);
108  break;
109 
110  case VERSION_7:
111  case VERSION_8:
112  case VERSION_9:
113  case VERSION_10:
114  case VERSION_11:
115  case VERSION_12:
116  loadVersions7AndUp (file);
117  break;
118 
119  default:
120  m_successfulRead = false;
121  m_reasonForUnsuccessfulRead = QString ("Engauge %1 %2 %3 %4 Engauge")
122  .arg (VERSION_NUMBER)
123  .arg (QObject::tr ("cannot read newer files from version"))
124  .arg (version)
125  .arg (QObject::tr ("of"));
126  break;
127  }
128 
129  // Close and deactivate
130  file->close ();
131  delete file;
132  file = nullptr;
133 
134  } else {
135 
136  m_successfulRead = false;
137  m_reasonForUnsuccessfulRead = QObject::tr ("Operating system says file is not readable");
138  }
139  }
140  } else {
141  fileVersion.close ();
142  m_successfulRead = false;
143  m_reasonForUnsuccessfulRead = QString ("%1 '%2' %3")
144  .arg (QObject::tr ("File"))
145  .arg (fileName)
146  .arg (QObject::tr ("was not found"));
147  }
148 }
const int VERSION_10
Definition: Document.cpp:49
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
const int VERSION_12
Definition: Document.cpp:51
const int VERSION_6
Definition: Document.cpp:45
const int VERSION_7
Definition: Document.cpp:46
const int NOMINAL_COORD_SYSTEM_COUNT
Definition: Document.cpp:44
const int VERSION_8
Definition: Document.cpp:47
const int FOUR_BYTES
Definition: CoordSystem.cpp:37
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const char * VERSION_NUMBER
Definition: Version.cpp:12
const int VERSION_9
Definition: Document.cpp:48
const int VERSION_11
Definition: Document.cpp:50

Member Function Documentation

void Document::addCoordSystems ( unsigned int  numberCoordSystemToAdd)

Add some number (0 or more) of additional coordinate systems.

This is only safe to call during import and before any changes have been made to the Document

Definition at line 150 of file Document.cpp.

151 {
152  LOG4CPP_INFO_S ((*mainCat)) << "Document::addCoordSystems"
153  << " toAdd=" << numberCoordSystemToAdd;
154 
155  m_coordSystemContext.addCoordSystems(numberCoordSystemToAdd);
156 }
void addCoordSystems(unsigned int numberCoordSystemToAdd)
Add specified number of coordinate systems to the original one created by the constructor.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::addGraphCurveAtEnd ( const QString &  curveName)

Add new graph curve to the list of existing graph curves.

Definition at line 158 of file Document.cpp.

159 {
160  LOG4CPP_INFO_S ((*mainCat)) << "Document::addGraphCurveAtEnd";
161 
162  m_coordSystemContext.addGraphCurveAtEnd (curveName);
163 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void addGraphCurveAtEnd(const QString &curveName)
Add new graph curve to the list of existing graph curves.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::addPointAxisWithGeneratedIdentifier ( const QPointF &  posScreen,
const QPointF &  posGraph,
QString &  identifier,
double  ordinal,
bool  isXOnly 
)

Add a single axis point with a generated point identifier.

Call this after checkAddPointAxis to guarantee success in this call.

Parameters
posScreenScreen coordinates from QGraphicsView
posGraphGraph coordiantes from user
identifierIdentifier for new axis point
ordinalUnique, for curve, ordinal number
isXOnlyTrue if point has only an x coordinate

Definition at line 165 of file Document.cpp.

170 {
171  LOG4CPP_INFO_S ((*mainCat)) << "Document::addPointAxisWithGeneratedIdentifier";
172 
173  m_coordSystemContext.addPointAxisWithGeneratedIdentifier(posScreen,
174  posGraph,
175  identifier,
176  ordinal,
177  isXOnly);
178 }
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Definition: Document.cpp:444
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
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.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::addPointAxisWithSpecifiedIdentifier ( const QPointF &  posScreen,
const QPointF &  posGraph,
const QString &  identifier,
double  ordinal,
bool  isXOnly 
)

Add a single axis point with the specified point identifier.

Call this after checkAddPointAxis to guarantee success in this call.

Parameters
posScreenScreen coordinates from QGraphicsView
posGraphGraph coordiantes from user
identifierIdentifier for new axis point
ordinalUnique, for curve, ordinal number
isXOnlyTrue if point has only an x coordinate

Definition at line 180 of file Document.cpp.

185 {
186  LOG4CPP_INFO_S ((*mainCat)) << "Document::addPointAxisWithSpecifiedIdentifier";
187 
188  m_coordSystemContext.addPointAxisWithSpecifiedIdentifier(posScreen,
189  posGraph,
190  identifier,
191  ordinal,
192  isXOnly);
193 }
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Definition: Document.cpp:444
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
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 Document::addPointGraphWithGeneratedIdentifier ( const QString &  curveName,
const QPointF &  posScreen,
QString &  generatedIentifier,
double  ordinal 
)

Add a single graph point with a generated point identifier.

Definition at line 195 of file Document.cpp.

199 {
200  LOG4CPP_INFO_S ((*mainCat)) << "Document::addPointGraphWithGeneratedIdentifier";
201 
202  m_coordSystemContext.addPointGraphWithGeneratedIdentifier(curveName,
203  posScreen,
204  identifier,
205  ordinal);
206 }
virtual void addPointGraphWithGeneratedIdentifier(const QString &curveName, const QPointF &posScreen, QString &generatedIentifier, double ordinal)
Add a single graph point with a generated point identifier.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::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 the point within the Document.

Definition at line 208 of file Document.cpp.

212 {
213  LOG4CPP_INFO_S ((*mainCat)) << "Document::addPointGraphWithSpecifiedIdentifier";
214 
215  m_coordSystemContext.addPointGraphWithSpecifiedIdentifier(curveName,
216  posScreen,
217  identifier,
218  ordinal);
219 }
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...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::addPointsInCurvesGraphs ( CurvesGraphs curvesGraphs)

Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.

Definition at line 221 of file Document.cpp.

222 {
223  LOG4CPP_INFO_S ((*mainCat)) << "Document::addPointsInCurvesGraphs";
224 
225  m_coordSystemContext.addPointsInCurvesGraphs(curvesGraphs);
226 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void addPointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Add all points identified in the specified CurvesGraphs. See also removePointsInCurvesGraphs.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::addScaleWithGeneratedIdentifier ( const QPointF &  posScreen0,
const QPointF &  posScreen1,
double  scaleLength,
QString &  identifier0,
QString &  identifier1,
double  ordinal0,
double  ordinal1 
)

Add scale with a generated point identifier.

Call this after checkAddPointAxis to guarantee success in this call.

Parameters
posScreen0Screen coordinates of first point from QGraphicsView
posScreen1Screen coordinates of second point from QGraphicsView
scaleLengthScale bar length in graph coordinates
identifier0Identifier for first new axis point
identifier1Identifier for second new axis point
ordinal0Unique, for curve, ordinal number of first point
ordinal1Unique, for curve, ordinal number of second point

Definition at line 228 of file Document.cpp.

235 {
236  LOG4CPP_INFO_S ((*mainCat)) << "Document::addScaleWithGeneratedIdentifier";
237 
238  const bool IS_X_ONLY = false;
239 
240  m_coordSystemContext.addPointAxisWithGeneratedIdentifier(posScreen0,
241  QPointF (0, 0),
242  identifier0,
243  ordinal0,
244  IS_X_ONLY);
245  m_coordSystemContext.addPointAxisWithGeneratedIdentifier(posScreen1,
246  QPointF (scaleLength, 0),
247  identifier1,
248  ordinal1,
249  IS_X_ONLY);
250 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
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.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::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)

Definition at line 268 of file Document.cpp.

273 {
274  LOG4CPP_INFO_S ((*mainCat)) << "Document::checkAddPointAxis";
275 
276  m_coordSystemContext.checkAddPointAxis(posScreen,
277  posGraph,
278  isError,
279  errorMessage,
280  isXOnly,
281  m_documentAxesPointsRequired);
282 }
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Definition: Document.cpp:444
virtual void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly, DocumentAxesPointsRequired documentAxesPointsRequired)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::checkEditPointAxis ( const QString &  pointIdentifier,
const QPointF &  posScreen,
const QPointF &  posGraph,
bool &  isError,
QString &  errorMessage 
)

Check before calling editPointAxis.

Definition at line 284 of file Document.cpp.

289 {
290  LOG4CPP_INFO_S ((*mainCat)) << "Document::checkEditPointAxis";
291 
292  m_coordSystemContext.checkEditPointAxis(pointIdentifier,
293  posScreen,
294  posGraph,
295  isError,
296  errorMessage,
297  m_documentAxesPointsRequired);
298 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, DocumentAxesPointsRequired documentAxesPointsRequired)
Check before calling editPointAxis.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const CoordSystem & Document::coordSystem ( ) const

Currently active CoordSystem.

Definition at line 300 of file Document.cpp.

301 {
302  LOG4CPP_INFO_S ((*mainCat)) << "Document::coordSystem";
303 
304  return m_coordSystemContext.coordSystem();
305 }
const CoordSystem & coordSystem() const
Current CoordSystem.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
unsigned int Document::coordSystemCount ( ) const

Number of CoordSystem.

Definition at line 307 of file Document.cpp.

308 {
309  LOG4CPP_INFO_S ((*mainCat)) << "Document::coordSystemCount";
310 
311  return m_coordSystemContext.coordSystemCount();
312 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
unsigned int coordSystemCount() const
Number of CoordSystem.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
CoordSystemIndex Document::coordSystemIndex ( ) const

Index of current active CoordSystem.

Definition at line 314 of file Document.cpp.

315 {
316  LOG4CPP_INFO_S ((*mainCat)) << "Document::coordSystemIndex";
317 
318  return m_coordSystemContext.coordSystemIndex();
319 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
CoordSystemIndex coordSystemIndex() const
Index of current CoordSystem.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const Curve & Document::curveAxes ( ) const

Get method for axis curve.

Definition at line 321 of file Document.cpp.

322 {
323  LOG4CPP_INFO_S ((*mainCat)) << "Document::curveAxes";
324 
325  return m_coordSystemContext.curveAxes();
326 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual const Curve & curveAxes() const
Get method for axis curve.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const Curve * Document::curveForCurveName ( const QString &  curveName) const

See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.

Definition at line 335 of file Document.cpp.

336 {
337  LOG4CPP_INFO_S ((*mainCat)) << "Document::curveForCurveName";
338 
339  return m_coordSystemContext.curveForCurveName (curveName);
340 }
virtual Curve * curveForCurveName(const QString &curveName)
See CurvesGraphs::curveForCurveName, although this also works for AXIS_CURVE_NAME.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const CurvesGraphs & Document::curvesGraphs ( ) const

Make all Curves available, read only, for CmdAbstract classes only.

Definition at line 342 of file Document.cpp.

343 {
344  LOG4CPP_INFO_S ((*mainCat)) << "Document::curvesGraphs";
345 
346  return m_coordSystemContext.curvesGraphs();
347 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual const CurvesGraphs & curvesGraphs() const
Make all Curves available, read only, for CmdAbstract classes only.
QStringList Document::curvesGraphsNames ( ) const

See CurvesGraphs::curvesGraphsNames.

Definition at line 349 of file Document.cpp.

350 {
351  LOG4CPP_INFO_S ((*mainCat)) << "Document::curvesGraphsNames";
352 
353  return m_coordSystemContext.curvesGraphsNames();
354 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
int Document::curvesGraphsNumPoints ( const QString &  curveName) const

See CurvesGraphs::curvesGraphsNumPoints.

Definition at line 356 of file Document.cpp.

357 {
358  LOG4CPP_INFO_S ((*mainCat)) << "Document::curvesGraphsNumPoints";
359 
360  return m_coordSystemContext.curvesGraphsNumPoints(curveName);
361 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual int curvesGraphsNumPoints(const QString &curveName) const
See CurvesGraphs::curvesGraphsNumPoints.
DocumentAxesPointsRequired Document::documentAxesPointsRequired ( ) const

Get method for DocumentAxesPointsRequired.

Definition at line 363 of file Document.cpp.

364 {
365  return m_documentAxesPointsRequired;
366 }
void Document::editPointAxis ( const QPointF &  posGraph,
const QString &  identifier 
)

Edit the graph coordinates of a single axis point. Call this after checkAddPointAxis to guarantee success in this call.

Definition at line 368 of file Document.cpp.

370 {
371  LOG4CPP_INFO_S ((*mainCat)) << "Document::editPointAxis";
372 
373  m_coordSystemContext.editPointAxis(posGraph,
374  identifier);
375 }
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...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::editPointGraph ( bool  isX,
bool  isY,
double  x,
double  y,
const QStringList &  identifiers,
const Transformation transformation 
)

Edit the graph coordinates of one or more graph points.

Definition at line 377 of file Document.cpp.

383 {
384  LOG4CPP_INFO_S ((*mainCat)) << "Document::editPointCurve";
385 
386  m_coordSystemContext.editPointGraph (isX,
387  isY,
388  x,
389  y,
390  identifiers,
391  transformation);
392 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void editPointGraph(bool isX, bool isY, double x, double y, const QStringList &identifiers, const Transformation &transformation)
Edit the graph coordinates of one or more graph points.
void Document::initializeGridDisplay ( const Transformation transformation)

Initialize grid display. This is called immediately after the transformation has been defined for the first time.

Definition at line 411 of file Document.cpp.

412 {
413  LOG4CPP_INFO_S ((*mainCat)) << "Document::initializeGridDisplay";
414 
415  ENGAUGE_ASSERT (!m_coordSystemContext.modelGridDisplay().stable());
416 
417  // Get graph coordinate bounds
418  CallbackBoundingRects ftor (m_documentAxesPointsRequired,
419  transformation);
420 
421  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
423 
424  iterateThroughCurvePointsAxes (ftorWithCallback);
425 
426  // Initialize. Note that if there are no graph points then these next steps have no effect
427  bool isEmpty;
428  QPointF boundingRectGraphMin = ftor.boundingRectGraphMin (isEmpty);
429  QPointF boundingRectGraphMax = ftor.boundingRectGraphMax (isEmpty);
430  if (!isEmpty) {
431 
432  GridInitializer gridInitializer;
433 
434  DocumentModelGridDisplay modelGridDisplay = gridInitializer.initializeWithWidePolarCoverage (boundingRectGraphMin,
435  boundingRectGraphMax,
436  modelCoords(),
437  transformation,
438  m_pixmap.size ());
439 
440  m_coordSystemContext.setModelGridDisplay (modelGridDisplay);
441  }
442 }
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
DocumentModelGridDisplay initializeWithWidePolarCoverage(const QPointF &boundingRectGraphMin, const QPointF &boundingRectGraphMax, const DocumentModelCoords &modelCoords, const Transformation &transformation, const QSize &imageSize) const
Initialize given the boundaries of the graph coordinates, and then extra processing for polar coordin...
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
Definition: Document.cpp:449
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition: Document.cpp:695
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
This class initializes the count, start, step and stop parameters for one coordinate (either x/theta ...
log4cpp::Category * mainCat
Definition: Logger.cpp:14
bool stable() const
Get method for stable flag.
DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
Definition: Document.cpp:730
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
Callback for computing the bounding rectangles of the screen and graph coordinates of the points in t...
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) &amp;&amp; !defined(QT_FORCE_ASSERTS) define ENGAUGE...
Definition: EngaugeAssert.h:20
bool Document::isXOnly ( const QString &  pointIdentifier) const

See Curve::isXOnly.

Definition at line 444 of file Document.cpp.

445 {
446  return m_coordSystemContext.isXOnly (pointIdentifier);
447 }
bool isXOnly(const QString &pointIdentifier) const
True/false if y/x value is empty.
void Document::iterateThroughCurvePointsAxes ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback)

See Curve::iterateThroughCurvePoints, for the axes curve.

Definition at line 449 of file Document.cpp.

450 {
451  LOG4CPP_INFO_S ((*mainCat)) << "Document::iterateThroughCurvePointsAxes";
452 
453  m_coordSystemContext.iterateThroughCurvePointsAxes(ftorWithCallback);
454 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
void Document::iterateThroughCurvePointsAxes ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback) const

See Curve::iterateThroughCurvePoints, for the axes curve.

Definition at line 456 of file Document.cpp.

457 {
458  LOG4CPP_INFO_S ((*mainCat)) << "Document::iterateThroughCurvePointsAxes";
459 
460  m_coordSystemContext.iterateThroughCurvePointsAxes(ftorWithCallback);
461 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
void Document::iterateThroughCurveSegments ( const QString &  curveName,
const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &  ftorWithCallback 
) const

See Curve::iterateThroughCurveSegments, for any axes or graph curve.

Definition at line 463 of file Document.cpp.

465 {
466  LOG4CPP_INFO_S ((*mainCat)) << "Document::iterateThroughCurveSegments";
467 
468  m_coordSystemContext.iterateThroughCurveSegments(curveName,
469  ftorWithCallback);
470 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void iterateThroughCurveSegments(const QString &curveName, const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const
See Curve::iterateThroughCurveSegments, for any axes or graph curve.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::iterateThroughCurvesPointsGraphs ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback)

See Curve::iterateThroughCurvePoints, for all the graphs curves.

Definition at line 472 of file Document.cpp.

473 {
474  LOG4CPP_INFO_S ((*mainCat)) << "Document::iterateThroughCurvesPointsGraphs";
475 
476  m_coordSystemContext.iterateThroughCurvesPointsGraphs(ftorWithCallback);
477 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
void Document::iterateThroughCurvesPointsGraphs ( const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &  ftorWithCallback) const

See Curve::iterateThroughCurvePoints, for all the graphs curves.

Definition at line 479 of file Document.cpp.

480 {
481  LOG4CPP_INFO_S ((*mainCat)) << "Document::iterateThroughCurvesPointsGraphs";
482 
483  m_coordSystemContext.iterateThroughCurvesPointsGraphs(ftorWithCallback);
484 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
bool Document::loadCurvesFile ( const QString &  curvesFile)

Load the curve names in the specified Engauge file into the current document. This is called near the end of the import process only.

DocumentModelAxesChecker Document::modelAxesChecker ( ) const

Get method for DocumentModelAxesChecker.

Definition at line 681 of file Document.cpp.

682 {
683  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelAxesChecker";
684 
685  return m_coordSystemContext.modelAxesChecker();
686 }
virtual DocumentModelAxesChecker modelAxesChecker() const
Get method for DocumentModelAxesChecker.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelColorFilter Document::modelColorFilter ( ) const

Get method for DocumentModelColorFilter.

Definition at line 688 of file Document.cpp.

689 {
690  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelColorFilter";
691 
692  return m_coordSystemContext.modelColorFilter();
693 }
virtual DocumentModelColorFilter modelColorFilter() const
Get method for DocumentModelColorFilter.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelCoords Document::modelCoords ( ) const

Get method for DocumentModelCoords.

Definition at line 695 of file Document.cpp.

696 {
697  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelCoords";
698 
699  return m_coordSystemContext.modelCoords();
700 }
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
CurveStyles Document::modelCurveStyles ( ) const

Get method for CurveStyles.

Definition at line 702 of file Document.cpp.

703 {
704  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelCurveStyles";
705 
706  return m_coordSystemContext.modelCurveStyles();
707 }
virtual CurveStyles modelCurveStyles() const
Get method for CurveStyles.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelDigitizeCurve Document::modelDigitizeCurve ( ) const

Get method for DocumentModelDigitizeCurve.

Definition at line 709 of file Document.cpp.

710 {
711  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelDigitizeCurve";
712 
713  return m_coordSystemContext.modelDigitizeCurve();
714 }
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
virtual DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
DocumentModelExportFormat Document::modelExport ( ) const

Get method for DocumentModelExportFormat.

Definition at line 716 of file Document.cpp.

717 {
718  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelExport";
719 
720  return m_coordSystemContext.modelExport();
721 }
virtual DocumentModelExportFormat modelExport() const
Get method for DocumentModelExportFormat.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelGeneral Document::modelGeneral ( ) const

Get method for DocumentModelGeneral.

Definition at line 723 of file Document.cpp.

724 {
725  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelGeneral";
726 
727  return m_coordSystemContext.modelGeneral();
728 }
virtual DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelGridDisplay Document::modelGridDisplay ( ) const

Get method for DocumentModelGridDisplay.

Definition at line 730 of file Document.cpp.

731 {
732  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelGridDisplay";
733 
734  return m_coordSystemContext.modelGridDisplay();
735 }
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual DocumentModelGridDisplay modelGridDisplay() const
Get method for DocumentModelGridDisplay.
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelGridRemoval Document::modelGridRemoval ( ) const

Get method for DocumentModelGridRemoval.

Definition at line 737 of file Document.cpp.

738 {
739  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelGridRemoval";
740 
741  return m_coordSystemContext.modelGridRemoval();
742 }
virtual DocumentModelGridRemoval modelGridRemoval() const
Get method for DocumentModelGridRemoval.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelPointMatch Document::modelPointMatch ( ) const

Get method for DocumentModelPointMatch.

Definition at line 744 of file Document.cpp.

745 {
746  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelPointMatch";
747 
748  return m_coordSystemContext.modelPointMatch();
749 }
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual DocumentModelPointMatch modelPointMatch() const
Get method for DocumentModelPointMatch.
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
DocumentModelSegments Document::modelSegments ( ) const

Get method for DocumentModelSegments.

Definition at line 751 of file Document.cpp.

752 {
753  LOG4CPP_DEBUG_S ((*mainCat)) << "Document::modelSegments";
754 
755  return m_coordSystemContext.modelSegments();
756 }
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual DocumentModelSegments modelSegments() const
Get method for DocumentModelSegments.
#define LOG4CPP_DEBUG_S(logger)
Definition: convenience.h:20
void Document::movePoint ( const QString &  pointIdentifier,
const QPointF &  deltaScreen 
)

See Curve::movePoint.

Definition at line 758 of file Document.cpp.

760 {
761  m_coordSystemContext.movePoint (pointIdentifier,
762  deltaScreen);
763 }
virtual void movePoint(const QString &pointIdentifier, const QPointF &deltaScreen)
See Curve::movePoint.
int Document::nextOrdinalForCurve ( const QString &  curveName) const

Default next ordinal value for specified curve.

Definition at line 765 of file Document.cpp.

766 {
767  LOG4CPP_INFO_S ((*mainCat)) << "Document::nextOrdinalForCurve";
768 
769  return m_coordSystemContext.nextOrdinalForCurve(curveName);
770 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
QPixmap Document::pixmap ( ) const

Return the image that is being digitized.

Definition at line 817 of file Document.cpp.

818 {
819  return m_pixmap;
820 }
QPointF Document::positionGraph ( const QString &  pointIdentifier) const

See Curve::positionGraph.

Definition at line 822 of file Document.cpp.

823 {
824  return m_coordSystemContext.positionGraph(pointIdentifier);
825 }
virtual QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
QPointF Document::positionScreen ( const QString &  pointIdentifier) const

See Curve::positionScreen.

Definition at line 827 of file Document.cpp.

828 {
829  return m_coordSystemContext.positionScreen(pointIdentifier);
830 }
virtual QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
void Document::print ( ) const

Debugging method for printing directly from symbolic debugger.

Definition at line 832 of file Document.cpp.

833 {
834  QString text;
835  QTextStream str (&text);
836 
837  printStream ("",
838  str);
839  std::cerr << text.toLatin1().data();
840 }
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: Document.cpp:842
void Document::printStream ( QString  indentation,
QTextStream &  str 
) const

Debugging method that supports print method of this class and printStream method of some other class(es)

Definition at line 842 of file Document.cpp.

844 {
845  str << indentation << "Document\n";
846 
847  indentation += INDENTATION_DELTA;
848 
849  str << indentation << "name=" << m_name << "\n";
850  str << indentation << "pixmap=" << m_pixmap.width() << "x" << m_pixmap.height() << "\n";
851 
852  m_coordSystemContext.printStream(indentation,
853  str);
854 }
const QString INDENTATION_DELTA
virtual void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
QString Document::reasonForUnsuccessfulRead ( ) const

Return an informative text message explaining why startup loading failed. Applies if successfulRead returns false.

Definition at line 856 of file Document.cpp.

857 {
858  ENGAUGE_ASSERT (!m_successfulRead);
859 
860  return m_reasonForUnsuccessfulRead;
861 }
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) &amp;&amp; !defined(QT_FORCE_ASSERTS) define ENGAUGE...
Definition: EngaugeAssert.h:20
void Document::removePointAxis ( const QString &  identifier)

Perform the opposite of addPointAxis.

Definition at line 863 of file Document.cpp.

864 {
865  LOG4CPP_INFO_S ((*mainCat)) << "Document::removePointAxis";
866 
867  m_coordSystemContext.removePointAxis(identifier);
868 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void removePointAxis(const QString &identifier)
Perform the opposite of addPointAxis.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::removePointGraph ( const QString &  identifier)

Perform the opposite of addPointGraph.

Definition at line 870 of file Document.cpp.

871 {
872  LOG4CPP_INFO_S ((*mainCat)) << "Document::removePointGraph";
873 
874  m_coordSystemContext.removePointGraph(identifier);
875 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void removePointGraph(const QString &identifier)
Perform the opposite of addPointGraph.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::removePointsInCurvesGraphs ( CurvesGraphs curvesGraphs)

Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.

Definition at line 877 of file Document.cpp.

878 {
879  LOG4CPP_INFO_S ((*mainCat)) << "Document::removePointsInCurvesGraphs";
880 
881  m_coordSystemContext.removePointsInCurvesGraphs(curvesGraphs);
882 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void removePointsInCurvesGraphs(CurvesGraphs &curvesGraphs)
Remove all points identified in the specified CurvesGraphs. See also addPointsInCurvesGraphs.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::saveXml ( QXmlStreamWriter &  writer) const

Save document to xml.

Definition at line 884 of file Document.cpp.

885 {
886  writer.writeStartElement(DOCUMENT_SERIALIZE_DOCUMENT);
887 
888  // Version number is tacked onto DOCUMENT_SERIALIZE_DOCUMENT since the alternative (creating a new start element)
889  // causes the code to complain during loading
891 
892  // Number of axes points required
893  writer.writeAttribute(DOCUMENT_SERIALIZE_AXES_POINTS_REQUIRED, QString::number (m_documentAxesPointsRequired));
894 
895  // Serialize the Document image. That binary data is encoded as base64
896  QByteArray array;
897  QDataStream str (&array, QIODevice::WriteOnly);
898  QImage img = m_pixmap.toImage ();
899  str << img;
900  writer.writeStartElement(DOCUMENT_SERIALIZE_IMAGE);
901 
902  // Image width and height are explicitly inserted for error reports, since the CDATA is removed
903  // but we still want the image size for reconstructing the error(s)
904  writer.writeAttribute(DOCUMENT_SERIALIZE_IMAGE_WIDTH, QString::number (img.width()));
905  writer.writeAttribute(DOCUMENT_SERIALIZE_IMAGE_HEIGHT, QString::number (img.height()));
906 
907  writer.writeCDATA (array.toBase64 ());
908  writer.writeEndElement();
909 
910  m_coordSystemContext.saveXml (writer);
911 }
const QString DOCUMENT_SERIALIZE_AXES_POINTS_REQUIRED
virtual void saveXml(QXmlStreamWriter &writer) const
Save graph to xml.
const QString DOCUMENT_SERIALIZE_IMAGE
const QString DOCUMENT_SERIALIZE_IMAGE_HEIGHT
const QString DOCUMENT_SERIALIZE_APPLICATION_VERSION_NUMBER
const QString DOCUMENT_SERIALIZE_IMAGE_WIDTH
const QString DOCUMENT_SERIALIZE_DOCUMENT
const char * VERSION_NUMBER
Definition: Version.cpp:12
QString Document::selectedCurveName ( ) const

Currently selected curve name. This is used to set the selected curve combobox in MainWindow.

Definition at line 913 of file Document.cpp.

914 {
915  return m_coordSystemContext.selectedCurveName();
916 }
virtual QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
void Document::setCoordSystemIndex ( CoordSystemIndex  coordSystemIndex)

Set the index of current active CoordSystem.

Definition at line 918 of file Document.cpp.

919 {
920  LOG4CPP_INFO_S ((*mainCat)) << "Document::setCoordSystemIndex";
921 
922  m_coordSystemContext.setCoordSystemIndex (coordSystemIndex);
923 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
CoordSystemIndex coordSystemIndex() const
Index of current active CoordSystem.
Definition: Document.cpp:314
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void setCoordSystemIndex(CoordSystemIndex coordSystemIndex)
Index of current CoordSystem.
void Document::setCurveAxes ( const Curve curveAxes)

Let CmdAbstract classes overwrite axes Curve.

Definition at line 925 of file Document.cpp.

926 {
927  LOG4CPP_INFO_S ((*mainCat)) << "Document::setCurveAxes";
928 
929  m_coordSystemContext.setCurveAxes (curveAxes);
930 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setCurveAxes(const Curve &curveAxes)
Let CmdAbstract classes overwrite axes Curve. Applies to current coordinate system.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setCurvesGraphs ( const CurvesGraphs curvesGraphs)

Let CmdAbstract classes overwrite CurvesGraphs.

Definition at line 932 of file Document.cpp.

933 {
934  LOG4CPP_INFO_S ((*mainCat)) << "Document::setCurvesGraphs";
935 
936  m_coordSystemContext.setCurvesGraphs(curvesGraphs);
937 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setCurvesGraphs(const CurvesGraphs &curvesGraphs)
Let CmdAbstract classes overwrite CurvesGraphs. Applies to current coordinate system.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setDocumentAxesPointsRequired ( DocumentAxesPointsRequired  documentAxesPointsRequired)

Set the number of axes points required.

This is called during the Document creation process, after imported images have been previewed or loaded files have had at least some xml parsing

Definition at line 939 of file Document.cpp.

940 {
941  LOG4CPP_INFO_S ((*mainCat)) << "Document::setDocumentAxesPointsRequired";
942 
943  m_documentAxesPointsRequired = documentAxesPointsRequired;
944 
946 
947  overrideGraphDefaultsWithMapDefaults ();
948  }
949 }
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition: Document.cpp:363
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelAxesChecker ( const DocumentModelAxesChecker modelAxesChecker)

Set method for DocumentModelAxesChecker.

Definition at line 951 of file Document.cpp.

952 {
953  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelAxesChecker";
954 
955  m_coordSystemContext.setModelAxesChecker(modelAxesChecker);
956 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelAxesChecker(const DocumentModelAxesChecker &modelAxesChecker)
Set method for DocumentModelAxesChecker.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelColorFilter ( const DocumentModelColorFilter modelColorFilter)

Set method for DocumentModelColorFilter.

Definition at line 958 of file Document.cpp.

959 {
960  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelColorFilter";
961 
962  // Save the CurveFilter for each Curve
963  ColorFilterSettingsList::const_iterator itr;
964  for (itr = modelColorFilter.colorFilterSettingsList().constBegin ();
965  itr != modelColorFilter.colorFilterSettingsList().constEnd();
966  itr++) {
967 
968  QString curveName = itr.key();
969  const ColorFilterSettings &colorFilterSettings = itr.value();
970 
971  Curve *curve = curveForCurveName (curveName);
972  curve->setColorFilterSettings (colorFilterSettings);
973  }
974 }
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings)
Set color filter.
Definition: Curve.cpp:546
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
Container for one set of digitized Points.
Definition: Curve.h:33
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
Definition: Document.cpp:335
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
void Document::setModelCoords ( const DocumentModelCoords modelCoords)

Set method for DocumentModelCoords.

Definition at line 976 of file Document.cpp.

977 {
978  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelCoords";
979 
980  m_coordSystemContext.setModelCoords(modelCoords);
981 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelCoords(const DocumentModelCoords &modelCoords)
Set method for DocumentModelCoords.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelCurveStyles ( const CurveStyles modelCurveStyles)

Set method for CurveStyles.

Definition at line 983 of file Document.cpp.

984 {
985  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelCurveStyles";
986 
987  // Save the LineStyle and PointStyle for each Curve
988  QStringList curveNames = modelCurveStyles.curveNames();
989  QStringList::iterator itr;
990  for (itr = curveNames.begin(); itr != curveNames.end(); itr++) {
991 
992  QString curveName = *itr;
993  const CurveStyle &curveStyle = modelCurveStyles.curveStyle (curveName);
994 
995  Curve *curve = curveForCurveName (curveName);
996  curve->setCurveStyle (curveStyle);
997  }
998 }
QStringList curveNames() const
List of all curve names.
Definition: CurveStyles.cpp:67
void setCurveStyle(const CurveStyle &curveStyle)
Set curve style.
Definition: Curve.cpp:563
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
Container for LineStyle and PointStyle for one Curve.
Definition: CurveStyle.h:18
Container for one set of digitized Points.
Definition: Curve.h:33
log4cpp::Category * mainCat
Definition: Logger.cpp:14
CurveStyle curveStyle(const QString &curveName) const
CurveStyle in specified curve.
Definition: CurveStyles.cpp:79
const Curve * curveForCurveName(const QString &curveName) const
See CurvesGraphs::curveForCurveNames, although this also works for AXIS_CURVE_NAME.
Definition: Document.cpp:335
void Document::setModelDigitizeCurve ( const DocumentModelDigitizeCurve modelDigitizeCurve)

Set method for DocumentModelDigitizeCurve.

Definition at line 1000 of file Document.cpp.

1001 {
1002  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelDigitizeCurve";
1003 
1004  m_coordSystemContext.setModelDigitizeCurve(modelDigitizeCurve);
1005 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Set method for DocumentModelDigitizeCurve.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelExport ( const DocumentModelExportFormat modelExport)

Set method for DocumentModelExportFormat.

Definition at line 1007 of file Document.cpp.

1008 {
1009  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelExport";
1010 
1011  m_coordSystemContext.setModelExport (modelExport);
1012 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelExport(const DocumentModelExportFormat &modelExport)
Set method for DocumentModelExportFormat.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelGeneral ( const DocumentModelGeneral modelGeneral)

Set method for DocumentModelGeneral.

Definition at line 1014 of file Document.cpp.

1015 {
1016  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelGeneral";
1017 
1018  m_coordSystemContext.setModelGeneral(modelGeneral);
1019 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void setModelGeneral(const DocumentModelGeneral &modelGeneral)
Set method for DocumentModelGeneral.
void Document::setModelGridDisplay ( const DocumentModelGridDisplay modelGridDisplay)

Set method for DocumentModelGridDisplay.

Definition at line 1021 of file Document.cpp.

1022 {
1023  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelGridDisplay";
1024 
1025  m_coordSystemContext.setModelGridDisplay(modelGridDisplay);
1026 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelGridDisplay(const DocumentModelGridDisplay &modelGridDisplay)
Set method for DocumentModelGridDisplay.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelGridRemoval ( const DocumentModelGridRemoval modelGridRemoval)

Set method for DocumentModelGridRemoval.

Definition at line 1028 of file Document.cpp.

1029 {
1030  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelGridRemoval";
1031 
1032  m_coordSystemContext.setModelGridRemoval(modelGridRemoval);
1033 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelGridRemoval(const DocumentModelGridRemoval &modelGridRemoval)
Set method for DocumentModelGridRemoval.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelPointMatch ( const DocumentModelPointMatch modelPointMatch)

Set method for DocumentModelPointMatch.

Definition at line 1035 of file Document.cpp.

1036 {
1037  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelPointMatch";
1038 
1039  m_coordSystemContext.setModelPointMatch(modelPointMatch);
1040 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
void setModelPointMatch(const DocumentModelPointMatch &modelPointMatch)
Set method for DocumentModelPointMatch.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setModelSegments ( const DocumentModelSegments modelSegments)

Set method for DocumentModelSegments.

Definition at line 1042 of file Document.cpp.

1043 {
1044  LOG4CPP_INFO_S ((*mainCat)) << "Document::setModelSegments";
1045 
1046  m_coordSystemContext.setModelSegments (modelSegments);
1047 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
virtual void setModelSegments(const DocumentModelSegments &modelSegments)
Set method for DocumentModelSegments.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setPixmap ( const QImage &  image)

Set method for the background pixmap.

Definition at line 1049 of file Document.cpp.

1050 {
1051  LOG4CPP_INFO_S ((*mainCat)) << "Document::setPixmap";
1052 
1053  m_pixmap = QPixmap::fromImage (image);
1054 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void Document::setSelectedCurveName ( const QString &  selectedCurveName)

Save curve name that is selected for the current coordinate system, for the next time the coordinate system reappears.

Definition at line 1056 of file Document.cpp.

1057 {
1058  m_coordSystemContext.setSelectedCurveName (selectedCurveName);
1059 }
virtual void setSelectedCurveName(const QString &selectedCurveName)
Save curve name that is selected for the current coordinate system, for the next time the coordinate ...
QString selectedCurveName() const
Currently selected curve name. This is used to set the selected curve combobox in MainWindow...
Definition: Document.cpp:913
bool Document::successfulRead ( ) const

Return true if startup loading succeeded. If the loading failed then reasonForUnsuccessfulRed will explain why.

Definition at line 1061 of file Document.cpp.

1062 {
1063  return m_successfulRead;
1064 }
void Document::updatePointOrdinals ( const Transformation transformation)

Update point ordinals after point addition/removal or dragging.

See GraphicsScene::updatePointOrdinalsAfterDrag. Graph coordinates of point must be up to date

Definition at line 1066 of file Document.cpp.

1067 {
1068  LOG4CPP_INFO_S ((*mainCat)) << "Document::updatePointOrdinals";
1069 
1070  m_coordSystemContext.updatePointOrdinals(transformation);
1071 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
virtual void updatePointOrdinals(const Transformation &transformation)
Update point ordinals after point addition/removal or dragging.

The documentation for this class was generated from the following files: