Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateEmpty.cpp
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
9#include "Logger.h"
10#include "MainWindow.h"
11#include <QCursor>
12#include <QSize>
13#include "Transformation.h"
14
19
23
25{
26 return "";
27}
28
30 DigitizeState /* previousState */)
31{
32 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::begin";
33
34 setCursor(cmdMediator);
37}
38
39bool DigitizeStateEmpty::canPaste (const Transformation & /* transformation */,
40 const QSize & /* size */) const
41{
42 return false;
43}
44
45QCursor DigitizeStateEmpty::cursor(CmdMediator * /* cmdMediator */) const
46{
47 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::cursor";
48
49 return QCursor (Qt::ArrowCursor);
50}
51
53{
54 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::end";
55}
56
58{
59 return false;
60}
61
63 const QString &pointIdentifier)
64{
65 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleContextMenuEventAxis "
66 << " point=" << pointIdentifier.toLatin1 ().data ();
67}
68
70 const QStringList &pointIdentifiers)
71{
72 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty ::handleContextMenuEventGraph "
73 << "points=" << pointIdentifiers.join(",").toLatin1 ().data ();
74}
75
77{
78 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleCurveChange";
79}
80
82 Qt::Key key,
83 bool /* atLeastOneSelectedItem */)
84{
85 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleKeyPress"
86 << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
87}
88
90 QPointF /* posScreen */)
91{
92// LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseMove";
93}
94
96 QPointF /* posScreen */)
97{
98 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMousePress";
99}
100
102 QPointF /* posScreen */)
103{
104 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseRelease";
105}
106
108{
109 return "DigitizeStateEmpty";
110}
111
113{
114 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateAfterPointAddition";
115}
116
118 const DocumentModelDigitizeCurve & /*modelDigitizeCurve */)
119{
120 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelDigitizeCurve";
121}
122
124{
125 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelSegments";
126}
DigitizeState
Set of possible states of Digitize toolbar.
log4cpp::Category * mainCat
Definition Logger.cpp:14
Command queue stack.
Definition CmdMediator.h:24
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
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 bool guidelinesAreSelectable() const
Enable/disable guidelines according to state.
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 handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click, on an axis point, that was intercepted earlier.
virtual bool canPaste(const Transformation &transformation, const QSize &viewSize) const
Return true if there is good data in the clipboard for pasting, and that is compatible with the curre...
virtual void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
Handle a right click, on a graph point, that was intercepted earlier.
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.
virtual void updateAfterPointAddition()
Update graphics attributes after possible new points. This is useful for highlight opacity.
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...
void handleGuidelinesActiveChange(bool active)
Handle Guidelines active status toggle.
Affine transformation between screen and graph coordinates, based on digitized axis points.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20