7 #include "CmdAddPointGraph.h"
8 #include "CmdMediator.h"
9 #include "CursorFactory.h"
10 #include "DigitizeStateContext.h"
11 #include "DigitizeStateCurve.h"
13 #include "MainWindow.h"
14 #include "OrdinalGenerator.h"
16 #include <QGraphicsScene>
24 DigitizeStateCurve::~DigitizeStateCurve ()
36 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::begin";
45 LOG4CPP_DEBUG_S ((*mainCat)) <<
"DigitizeStateCurve::cursor";
55 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::end";
60 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::handleCurveChange";
67 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::handleKeyPress"
68 <<
" key=" << QKeySequence (key).toString ().toLatin1 ().data ();
80 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::handleMousePress";
86 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::handleMouseRelease";
94 context ().mainWindow().selectedGraphCurve(),
106 return "DigitizeStateCurve";
112 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::updateModelDigitizeCurve";
119 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateCurve::updateModelSegments";
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
Transformation transformation() const
Return read-only copy of transformation.
void setDragMode(QGraphicsView::DragMode dragMode)
Set QGraphicsView drag mode (in m_view). Called from DigitizeStateAbstractBase subclasses.
Create standard cross cursor, or custom cursor, according to settings.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
DigitizeStateCurve(DigitizeStateContext &context)
Single constructor.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
virtual QString state() const
State name for debugging.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
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...
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
Command for adding one graph point.
Storage of one imported image and the data attached to that image.
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...
Utility class for generating ordinal numbers.
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
Model for DlgSettingsSegments and CmdSettingsSegments.
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
double generateCurvePointOrdinal(const Document &document, const Transformation &transformation, const QPointF &posScreen, const QString &curveName)
Select ordinal so new point curve passes smoothly through existing points.
QCursor generate(const DocumentModelDigitizeCurve &modelDigitizeCurve) const
Factory method to generate standard or custom cursor.
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 void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.