1 #include "CmdEditPointAxis.h"
2 #include "CmdMediator.h"
3 #include "DigitizeStateAbstractBase.h"
4 #include "DigitizeStateContext.h"
5 #include "DlgEditPoint.h"
8 #include "MainWindow.h"
9 #include <QApplication>
10 #include <QGraphicsScene>
12 #include <QMessageBox>
14 #include "QtToString.h"
19 m_isOverrideCursor (false)
23 DigitizeStateAbstractBase::~DigitizeStateAbstractBase()
39 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleContextMenuEvent point=" << pointIdentifier.toLatin1 ().data ();
45 double x = posGraphBefore.x();
46 double y = posGraphBefore.y();
49 context().cmdMediator().document().modelCoords(),
50 context().mainWindow().modelMainWindow(),
52 context().mainWindow().transformation(),
55 int rtn = dlg->exec ();
57 QPointF posGraphAfter = dlg->
posGraph ();
60 if (rtn == QDialog::Accepted) {
75 QMessageBox::warning (0,
83 context().cmdMediator().document(),
94 LOG4CPP_DEBUG_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleLeave";
103 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleSetOverrideCursor setOverrideCursor="
104 << QtCursorToString (cursor.shape ()).toLatin1 ().data ();
106 QApplication::setOverrideCursor (cursor);
107 m_isOverrideCursor =
true;
112 if (m_isOverrideCursor) {
114 LOG4CPP_INFO_S ((*mainCat)) <<
"DigitizeStateAbstractBase::handleLeave restoreOverrideCursor="
115 << QtCursorToString (QApplication::overrideCursor ()->shape ()).toLatin1 ().data ();
118 QApplication::restoreOverrideCursor ();
120 m_isOverrideCursor =
false;
126 LOG4CPP_DEBUG_S ((*mainCat)) <<
"DigitizeStateAbstractBase::setCursor";
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
CmdMediator & cmdMediator()
Provide CmdMediator for indirect access to the Document.
virtual void handleLeave()
Handle leave in case an override cursor is in effect from last QDialog, by resetting the override cur...
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.
QPointF posGraph() const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted...
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
void setCursor()
Update the cursor according to the current state.
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
Dialog box for editing the information of one axis point.
void appendNewCmd(QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
void handleContextMenuEvent(const QString &pointIdentifier)
Handle a right click that was intercepted earlier. This is done in the superclass since it works the ...
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.
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
void handleSetOverrideCursor(const QCursor &cursor)
Handle the command to set the override cursor.
virtual QCursor cursor() const =0
Returns the state-specific cursor shape.