Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateEmpty.cpp
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#include "DigitizeStateEmpty.h"
8#include "DigitizeStateContext.h"
9#include "Logger.h"
10#include "MainWindow.h"
11#include <QCursor>
12
17
18DigitizeStateEmpty::~DigitizeStateEmpty ()
19{
20}
21
23{
24 return "";
25}
26
28 DigitizeState /* previousState */)
29{
30 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::begin";
31
32 setCursor(cmdMediator);
34}
35
36QCursor DigitizeStateEmpty::cursor(CmdMediator * /* cmdMediator */) const
37{
38 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::cursor";
39
40 return QCursor (Qt::ArrowCursor);
41}
42
44{
45 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::end";
46}
47
49{
50 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleCurveChange";
51}
52
54 Qt::Key key,
55 bool /* atLeastOneSelectedItem */)
56{
57 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleKeyPress"
58 << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
59}
60
62 QPointF /* posScreen */)
63{
64// LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseMove";
65}
66
68 QPointF /* posScreen */)
69{
70 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMousePress";
71}
72
74 QPointF /* posScreen */)
75{
76 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseRelease";
77}
78
80{
81 return "DigitizeStateEmpty";
82}
83
85 const DocumentModelDigitizeCurve & /*modelDigitizeCurve */)
86{
87 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelDigitizeCurve";
88}
89
91{
92 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelSegments";
93}
Command queue stack.
Definition CmdMediator.h:24
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
virtual void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
virtual void handleMouseMove(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mod...
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
DigitizeStateEmpty(DigitizeStateContext &context)
Single constructor.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
virtual QString state() const
State name for debugging.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsSegments and CmdSettingsSegments.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...