7 #include "CmdEditPointAxis.h" 8 #include "CmdMediator.h" 9 #include "DigitizeStateAbstractBase.h" 10 #include "DigitizeStateContext.h" 11 #include "DlgEditPoint.h" 14 #include "MainWindow.h" 15 #include <QApplication> 16 #include <QGraphicsScene> 18 #include <QMessageBox> 20 #include "QtToString.h" 25 m_isOverrideCursor (false)
29 DigitizeStateAbstractBase::~DigitizeStateAbstractBase()
44 const QString &pointIdentifier)
46 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleContextMenuEvent point=" << pointIdentifier.toLatin1 ().data ();
53 double x = posGraphBefore.x();
54 double y = posGraphBefore.y();
66 int rtn = dlg->exec ();
68 QPointF posGraphAfter = dlg->
posGraph (isXOnly);
71 if (rtn == QDialog::Accepted) {
86 QMessageBox::warning (0,
107 LOG4CPP_DEBUG_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleLeave";
117 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleSetOverrideCursor setOverrideCursor=" 118 << QtCursorToString (cursor.shape ()).toLatin1 ().data ();
120 QApplication::setOverrideCursor (cursor);
121 m_isOverrideCursor =
true;
126 if (m_isOverrideCursor) {
128 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleLeave restoreOverrideCursor=" 129 << QtCursorToString (QApplication::overrideCursor ()->shape ()).toLatin1 ().data ();
132 QApplication::restoreOverrideCursor ();
134 m_isOverrideCursor =
false;
140 LOG4CPP_DEBUG_S ((*mainCat)) <<
"DigitizeStateAbstractBase::setCursor";
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Transformation transformation() const
Return read-only copy of transformation.
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted...
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
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...
void handleContextMenuEvent(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click that was intercepted earlier. This is done in the superclass since it works the ...
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
Dialog box for editing the information of one axis point.
virtual void handleLeave(CmdMediator *cmdMediator)
Handle leave in case an override cursor is in effect from last QDialog, by resetting the override cur...
void removeOverrideCursor()
Remove the override cursor if it is in use. This is called after a leave event, and prior to displayi...
QGraphicsView & view()
QGraphicsView for use by DigitizeStateAbstractBase subclasses.
Command for editing the graph coordinates one axis point.
void handleSetOverrideCursor(CmdMediator *cmdMediator, const QCursor &cursor)
Handle the command to set the override cursor.
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
MainWindowModel modelMainWindow() const
Get method for main window model.