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