Engauge Digitizer  2
TransformationStateContext.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_CONTEXT_H
8 #define TRANSFORMATION_STATE_CONTEXT_H
9 
10 #include <QVector>
11 #include "TransformationStateAbstractBase.h"
12 
13 class CmdMediator;
15 class QGraphicsScene;
16 class Transformation;
17 
22 {
23 public:
25  TransformationStateContext(QGraphicsScene &scene,
26  bool isGnuplot);
27  virtual ~TransformationStateContext();
28 
30  bool isGnuplot () const;
31 
33  void resetOnLoad();
34 
36  void triggerStateTransition (TransformationState transformationState,
37  CmdMediator &cmdMediator,
38  const Transformation &transformation,
39  const QString &selectedGraphCurve);
40 
42  void updateAxesChecker (CmdMediator &cmdMediator,
43  const Transformation &transformation);
44 
45 private:
47 
48  QVector<TransformationStateAbstractBase*> m_states;
49  TransformationState m_currentState;
50  bool m_isGnuplot;
51 };
52 
53 #endif // TRANSFORMATION_STATE_CONTEXT_H
Context class for transformation state machine.
void triggerStateTransition(TransformationState transformationState, CmdMediator &cmdMediator, const Transformation &transformation, const QString &selectedGraphCurve)
Trigger a state transition to be performed immediately.
bool isGnuplot() const
Flag for gnuplot debug files.
Affine transformation between screen and graph coordinates, based on digitized axis points...
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded...
Model for DlgSettingsAxesChecker and CmdSettingsAxesChecker.
Command queue stack.
Definition: CmdMediator.h:23
void updateAxesChecker(CmdMediator &cmdMediator, const Transformation &transformation)
Apply the new DocumentModelAxesChecker.