Engauge Digitizer  2
DocumentModelGridRemoval.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_GRID_REMOVAL_H
8 #define DOCUMENT_MODEL_GRID_REMOVAL_H
9 
10 #include "DocumentModelAbstractBase.h"
11 #include "GridCoordDisable.h"
12 
13 class Document;
14 class QTextStream;
15 
18 {
19 public:
22 
25  double startY,
26  double stepX,
27  double stepY,
28  int countX,
29  int countY);
30 
32  DocumentModelGridRemoval(const Document &document);
33 
36 
39 
41  double closeDistance() const;
42 
44  int countX() const;
45 
47  int countY() const;
48 
50  GridCoordDisable gridCoordDisableX () const;
51 
53  GridCoordDisable gridCoordDisableY () const;
54 
55  virtual void loadXml(QXmlStreamReader &reader);
56 
58  void printStream (QString indentation,
59  QTextStream &str) const;
60 
62  bool removeDefinedGridLines () const;
63 
64  virtual void saveXml(QXmlStreamWriter &writer) const;
65 
67  void setCloseDistance (double closeDistance);
68 
70  void setCountX(int countX);
71 
73  void setCountY(int countY);
74 
76  void setGridCoordDisableX (GridCoordDisable gridCoordDisable);
77 
79  void setGridCoordDisableY (GridCoordDisable gridCoordDisable);
80 
82  void setRemoveDefinedGridLines (bool removeDefinedGridLines);
83 
85  void setStable ();
86 
88  void setStartX(double startX);
89 
91  void setStartY(double startY);
92 
94  void setStepX(double stepX);
95 
97  void setStepY(double stepY);
98 
100  void setStopX(double stopX);
101 
103  void setStopY(double stopY);
104 
107  bool stable() const;
108 
110  double startX() const;
111 
113  double startY() const;
114 
116  double stepX() const;
117 
119  double stepY() const;
120 
122  double stopX() const;
123 
125  double stopY() const;
126 
127 private:
128 
129  void setStable (bool stable); // Private version is for initialization
130 
131  bool m_stable;
132  bool m_removeDefinedGridLines;
133  double m_closeDistance;
134  GridCoordDisable m_gridCoordDisableX;
135  int m_countX;
136  double m_startX;
137  double m_stepX;
138  double m_stopX;
139  GridCoordDisable m_gridCoordDisableY;
140  int m_countY;
141  double m_startY;
142  double m_stepY;
143  double m_stopY;
144 };
145 
146 #endif // DOCUMENT_MODEL_GRID_REMOVAL_H
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
double closeDistance() const
Get method for close distance.
bool stable() const
Get method for stable flag.
Abstract base class for document models. This class enforces a common interface for the leaf subclass...
DocumentModelGridRemoval()
Default constructor.
GridCoordDisable gridCoordDisableX() const
Get method for x coord parameter to disable.
double stopY() const
Get method for y stop.
void setCloseDistance(double closeDistance)
Set method for close distance.
double stopX() const
Get method for x stop.
int countY() const
Get method for y count.
void setCountX(int countX)
Set method for x count.
double startY() const
Get method for y start.
void setStopY(double stopY)
Set method for y stop.
void setStartY(double startY)
Set method for y start.
void setStepY(double stepY)
Set method for y step.
void setStartX(double startX)
Set method for x start.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
double stepX() const
Get method for x step.
DocumentModelGridRemoval & operator=(const DocumentModelGridRemoval &other)
Assignment constructor.
void setCountY(int countY)
Set method for y count.
bool removeDefinedGridLines() const
Get method for removing defined grid lines.
void setStepX(double stepX)
Set method for x step.
void setRemoveDefinedGridLines(bool removeDefinedGridLines)
Set method for removing defined grid lines.
Storage of one imported image and the data attached to that image.
Definition: Document.h:41
void setGridCoordDisableY(GridCoordDisable gridCoordDisable)
Set method for y coord parameter to disable.
void setGridCoordDisableX(GridCoordDisable gridCoordDisable)
Set method for x coord parameter to disable.
int countX() const
Get method for x count.
void setStable()
Set the stable flag to true. This public version has no argument since it cannot be undone...
double startX() const
Get method for x start.
Model for DlgSettingsGridRemoval and CmdSettingsGridRemoval. The settings are unstable until the user...
GridCoordDisable gridCoordDisableY() const
Get method for y coord parameter to disable.
void setStopX(double stopX)
Set method for x stop.
double stepY() const
Get method for y step.