Engauge Digitizer  2
TransformationStateDefined.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 TRANSFORMATION_STATE_DEFINED_H
8 #define TRANSFORMATION_STATE_DEFINED_H
9 
10 #include "Checker.h"
11 #include <QObject>
12 #include "Transformation.h"
13 #include "TransformationStateAbstractBase.h"
14 
15 class QTimer;
16 
19 {
20  Q_OBJECT;
21 
22 public:
25  QGraphicsScene &scene);
26 
27  virtual void begin(CmdMediator &cmdMediator,
28  const Transformation &transformation,
29  const QString &selectedGraphCurve);
30  virtual void end(CmdMediator &cmdMediator,
31  const Transformation &transformation);
32  virtual void updateAxesChecker (CmdMediator &cmdMediator,
33  const Transformation &transformation);
34 
35 private slots:
36  void slotTimeout();
37 
38 private:
40 
41  void initializeModelGridDisplay (CmdMediator &cmdMediator,
42  const Transformation &transformation);
43  void initializeModelGridRemoval (CmdMediator &cmdMediator,
44  const Transformation &transformation,
45  const QString &selectedGraphCurve);
46  void startTimer (const DocumentModelAxesChecker &modelAxesChecker);
47 
48  // As a QGraphicsItem subclass, the Checker is deleted by the QGraphicsScene so it must be a pointer
49  Checker *m_axesChecker;
50 
51  QTimer *m_timer;
52 };
53 
54 #endif // TRANSFORMATION_STATE_DEFINED_H
Base class for all transformation states. This serves as an interface to TransformationStateContext.
Context class for transformation state machine.
Class to show transformation since transformation is defined.
Box shape that is drawn through the three axis points, to temporarily (usually) or permanently (rarel...
Definition: Checker.h:33
virtual void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.
TransformationStateContext & context()
Reference to the TransformationStateContext that contains all the TransformationStateAbstractBase sub...
Affine transformation between screen and graph coordinates, based on digitized axis points...
virtual void end(CmdMediator &cmdMediator, const Transformation &transformation)
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
virtual void begin(CmdMediator &cmdMediator, const Transformation &transformation, const QString &selectedGraphCurve)
Method that is called at the exact moment a state is entered. Typically called just after end for the...
Command queue stack.
Definition: CmdMediator.h:23