Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
DigitizeStateEmpty.cpp
1 #include "DigitizeStateEmpty.h"
2 #include "DigitizeStateContext.h"
3 #include "Logger.h"
4 #include "MainWindow.h"
5 #include <QCursor>
6 
9 {
10 }
11 
12 DigitizeStateEmpty::~DigitizeStateEmpty ()
13 {
14 }
15 
17 {
18  return "";
19 }
20 
21 void DigitizeStateEmpty::begin (DigitizeState /* previousState */)
22 {
23  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::begin";
24 
25  setCursor();
27 }
28 
30 {
31  LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::cursor";
32 
33  return QCursor (Qt::ArrowCursor);
34 }
35 
37 {
38  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::end";
39 }
40 
42 {
43  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleCurveChange";
44 }
45 
47  bool /* atLeastOneSelectedItem */)
48 {
49  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleKeyPress"
50  << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
51 }
52 
53 void DigitizeStateEmpty::handleMouseMove (QPointF /* posScreen */)
54 {
55 // LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseMove";
56 }
57 
58 void DigitizeStateEmpty::handleMousePress (QPointF /* posScreen */)
59 {
60  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMousePress";
61 }
62 
63 void DigitizeStateEmpty::handleMouseRelease (QPointF /* posScreen */)
64 {
65  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::handleMouseRelease";
66 }
67 
69 {
70  return "DigitizeStateEmpty";
71 }
72 
74 {
75  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelDigitizeCurve";
76 }
77 
79 {
80  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateEmpty::updateModelSegments";
81 }
virtual void begin(DigitizeState previousState)
Method that is called at the exact moment a state is entered.
virtual QCursor cursor() const
Returns the state-specific cursor shape.
virtual void handleKeyPress(Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
DigitizeStateEmpty(DigitizeStateContext &context)
Single constructor.
virtual void handleCurveChange()
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
virtual void handleMousePress(QPointF posScreen)
Handle a mouse press 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...
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
void setCursor()
Update the cursor according to the current state.
virtual void updateModelDigitizeCurve(const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
Model for DlgSettingsSegments and CmdSettingsSegments.
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
virtual void handleMouseMove(QPointF posScreen)
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mod...
virtual QString state() const
State name for debugging.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void handleMouseRelease(QPointF posScreen)
Handle a mouse release that was intercepted earlier.