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>
20#include "QtToString.h"
25 m_isOverrideCursor (false)
29DigitizeStateAbstractBase::~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();
59 context().mainWindow().modelMainWindow(),
61 context().mainWindow().transformation(),
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";
113 const QCursor &cursor)
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";
Command for editing the graph coordinates one axis point.
void handleSetOverrideCursor(CmdMediator *cmdMediator, const QCursor &cursor)
Handle the command to set the override cursor.
void removeOverrideCursor()
Remove the override cursor if it is in use. This is called after a leave event, and prior to displayi...
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
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 ...
virtual QCursor cursor(CmdMediator *cmdMediator) const =0
Returns the state-specific cursor shape.
virtual void handleLeave(CmdMediator *cmdMediator)
Handle leave in case an override cursor is in effect from last QDialog, by resetting the override cur...
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...
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
QGraphicsView & view()
QGraphicsView for use by DigitizeStateAbstractBase subclasses.
MainWindow & mainWindow()
Reference to the MainWindow, without const.
Dialog box for editing the information of one axis point.
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted.
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
CmdMediator * cmdMediator()
Accessor for commands to process the Document.