Engauge Digitizer  2
DocumentModelCoords.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef DOCUMENT_MODEL_COORDS_H
8 #define DOCUMENT_MODEL_COORDS_H
9 
10 #include "CoordScale.h"
11 #include "CoordsType.h"
12 #include "CoordUnitsNonPolarTheta.h"
13 #include "CoordUnitsPolarTheta.h"
14 #include "DocumentModelAbstractBase.h"
15 
16 class Document;
17 class QTextStream;
18 
21 {
22 public:
25 
27  DocumentModelCoords(const Document &document);
28 
31 
34 
36  CoordScale coordScaleXTheta () const;
37 
39  CoordScale coordScaleYRadius () const;
40 
42  CoordsType coordsType () const;
43 
45  CoordUnitsDate coordUnitsDate () const;
46 
48  CoordUnitsNonPolarTheta coordUnitsRadius () const;
49 
51  CoordUnitsPolarTheta coordUnitsTheta () const;
52 
54  CoordUnitsTime coordUnitsTime () const;
55 
57  CoordUnitsNonPolarTheta coordUnitsX () const;
58 
60  CoordUnitsNonPolarTheta coordUnitsY () const;
61 
62  virtual void loadXml(QXmlStreamReader &reader);
63 
65  double originRadius () const;
66 
68  void printStream (QString indentation,
69  QTextStream &str) const;
70 
71  virtual void saveXml(QXmlStreamWriter &writer) const;
72 
74  void setCoordScaleXTheta (CoordScale coordScale);
75 
77  void setCoordScaleYRadius (CoordScale coordScale);
78 
80  void setCoordsType (CoordsType coordsType);
81 
83  void setCoordUnitsDate (CoordUnitsDate coordUnits);
84 
86  void setCoordUnitsRadius (CoordUnitsNonPolarTheta coordUnits);
87 
89  void setCoordUnitsTheta (CoordUnitsPolarTheta coordUnits);
90 
92  void setCoordUnitsTime (CoordUnitsTime coordUnits);
93 
95  void setCoordUnitsX (CoordUnitsNonPolarTheta coordUnits);
96 
98  void setCoordUnitsY (CoordUnitsNonPolarTheta coordUnits);
99 
101  void setOriginRadius (double originRadius);
102 
104  double thetaPeriod () const;
105 
106 private:
107 
108  CoordsType m_coordsType;
109  double m_originRadius; // Applies to polar coordinates. Usually zero
110  CoordScale m_coordScaleXTheta;
111  CoordScale m_coordScaleYRadius;
112  CoordUnitsNonPolarTheta m_coordUnitsX; // Applies to x for cartesian coordinates
113  CoordUnitsNonPolarTheta m_coordUnitsY; // Applies to y for cartesian coordinates
114  CoordUnitsPolarTheta m_coordUnitsTheta; // Applies to theta for polar coordinates
115  CoordUnitsNonPolarTheta m_coordUnitsRadius; // Applies to radius for polar coordinates
116  CoordUnitsDate m_coordUnitsDate; // Applies to date/time coordinates
117  CoordUnitsTime m_coordUnitsTime;
118 };
119 
120 #endif // DOCUMENT_MODEL_COORDS_H
void setCoordUnitsTime(CoordUnitsTime coordUnits)
Set method for time units.
void setCoordUnitsDate(CoordUnitsDate coordUnits)
Set method for date units.
Abstract base class for document models. This class enforces a common interface for the leaf subclass...
void setCoordUnitsY(CoordUnitsNonPolarTheta coordUnits)
Set method for y units.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
void setCoordUnitsX(CoordUnitsNonPolarTheta coordUnits)
Set method for x units.
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
double originRadius() const
Get method for origin radius in polar mode.
void setCoordScaleYRadius(CoordScale coordScale)
Set method for linear/log scale on y/radius.
CoordUnitsNonPolarTheta coordUnitsRadius() const
Get method for radius units.
CoordUnitsTime coordUnitsTime() const
Get method for time format when used.
DocumentModelCoords & operator=(const DocumentModelCoords &other)
Assignment constructor.
DocumentModelCoords()
Default constructor.
double thetaPeriod() const
Return the period of the theta value for polar coordinates, consistent with CoordThetaUnits.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
CoordUnitsNonPolarTheta coordUnitsY() const
Get method for x units.
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
void setCoordUnitsTheta(CoordUnitsPolarTheta coordUnits)
Set method for theta units.
CoordsType coordsType() const
Get method for coordinates type.
CoordUnitsNonPolarTheta coordUnitsX() const
Get method for x units.
Model for DlgSettingsCoords and CmdSettingsCoords.
void setOriginRadius(double originRadius)
Set method for origin radius in polar mode.
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
CoordUnitsDate coordUnitsDate() const
Get method for date format when used.
void setCoordUnitsRadius(CoordUnitsNonPolarTheta coordUnits)
Set method for radius units.
void setCoordScaleXTheta(CoordScale coordScale)
Set method for linear/log scale on x/theta.
CoordUnitsPolarTheta coordUnitsTheta() const
Get method for theta unit.
void setCoordsType(CoordsType coordsType)
Set method for coordinates type.