Engauge Digitizer 2
Loading...
Searching...
No Matches
DigitizeStateSelect.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "CallbackScaleBar.h"
8#include "CmdEditPointAxis.h"
9#include "CmdEditPointGraph.h"
10#include "CmdMediator.h"
11#include "CmdMoveBy.h"
12#include "DataKey.h"
14#include "DigitizeStateSelect.h"
15#include "DlgEditPointAxis.h"
16#include "DlgEditPointGraph.h"
17#include "DlgEditScale.h"
18#include "EngaugeAssert.h"
20#include "GraphicsItemType.h"
21#include "GraphicsScene.h"
22#include "GraphicsView.h"
23#include "Logger.h"
24#include "MainWindow.h"
25#include <QCursor>
26#include <QGraphicsItem>
27#include <QImage>
28#include <QMessageBox>
29#include <QObject>
30#include <QSize>
31#include <QtToString.h>
32#include "Transformation.h"
33#include "Version.h"
34
35const QString MOVE_TEXT_DOWN (QObject::tr ("Move down"));
36const QString MOVE_TEXT_LEFT (QObject::tr ("Move left"));
37const QString MOVE_TEXT_RIGHT (QObject::tr ("Move right"));
38const QString MOVE_TEXT_UP (QObject::tr ("Move up"));
39
44
48
53
54void DigitizeStateSelect::addHoverHighlighting()
55{
56 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::addHoverHighlighting";
57
58 QList<QGraphicsItem*> items = context().mainWindow().scene().items();
59 QList<QGraphicsItem*>::iterator itr;
60 for (itr = items.begin (); itr != items.end (); itr++) {
61
62 QGraphicsItem *item = *itr;
65 item->setAcceptHoverEvents(true);
66 }
67 }
68}
69
71 DigitizeState /* previousState */)
72{
73 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::begin";
74
75 setCursor(cmdMediator);
76 context().setDragMode(QGraphicsView::RubberBandDrag);
77
78 addHoverHighlighting();
81}
82
83bool DigitizeStateSelect::canPaste (const Transformation & /* transformation */,
84 const QSize & /* viewSize */) const
85{
86 return false;
87}
88
89QCursor DigitizeStateSelect::cursor(CmdMediator * /* cmdMediator */) const
90{
91 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::cursor";
92
93 return QCursor (Qt::ArrowCursor);
94}
95
97{
98 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::end";
99
100 removeHoverHighlighting();
101}
102
104{
105 return true;
106}
107
109 const QString &pointIdentifier)
110{
111 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis "
112 << " point=" << pointIdentifier.toLatin1 ().data ();
113
115 handleContextMenuEventAxis2 (cmdMediator);
116 } else {
117 handleContextMenuEventAxis34 (cmdMediator,
118 pointIdentifier);
119 }
120}
121
122void DigitizeStateSelect::handleContextMenuEventAxis2 (CmdMediator *cmdMediator)
123{
124 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis2";
125
126 const bool IS_NOT_X_ONLY = false;
127
128 // The point identifier we want is not necessarily the one edited but is the one with the
129 // nonzero x or y (but not both) coordinate
130 QString pointIdentifier = scaleBarPointIdentifier (cmdMediator);
131
132 QPointF posScreen = cmdMediator->document().positionScreen (pointIdentifier);
133 QPointF posGraphBefore = cmdMediator->document().positionGraph (pointIdentifier);
134
135 // Ask user for scale length
136 double scaleLength = scaleBarLength (cmdMediator);
137 DlgEditScale *dlg = new DlgEditScale (context().mainWindow(),
138 cmdMediator->document().modelCoords(),
139 cmdMediator->document().modelGeneral(),
140 context().mainWindow().modelMainWindow(),
141 &scaleLength);
142 int rtn = dlg->exec ();
143
144 scaleLength = dlg->scaleLength (); // This call returns new value for scale length
145 delete dlg;
146
147 if (rtn == QDialog::Accepted) {
148
149 // User wants to edit the scale length, which is effectively editing this axis point, but let's perform sanity checks first
150
151 bool isError;
152 QString errorMessage;
153
154 bool isXNonzero = (qAbs (posGraphBefore.x()) > 0); // Identify which coordinate is to be edited
155 QPointF posGraphAfter (isXNonzero ? scaleLength : 0,
156 isXNonzero ? 0 : scaleLength);
158 posScreen,
159 posGraphAfter,
160 isError,
161 errorMessage);
162
163 if (isError) {
164
165 QMessageBox::warning (nullptr,
167 errorMessage);
168
169 } else {
170
171 // Create a command to change the scale length
172 CmdEditPointAxis *cmd = new CmdEditPointAxis (context().mainWindow(),
173 cmdMediator->document(),
174 pointIdentifier,
175 posGraphBefore,
176 posGraphAfter,
177 IS_NOT_X_ONLY);
178 context().appendNewCmd(cmdMediator,
179 cmd);
180 }
181 }
182}
183
184void DigitizeStateSelect::handleContextMenuEventAxis34 (CmdMediator *cmdMediator,
185 const QString &pointIdentifier)
186{
187 LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis34";
188
189 QPointF posScreen = cmdMediator->document().positionScreen (pointIdentifier);
190 QPointF posGraphBefore = cmdMediator->document().positionGraph (pointIdentifier);
191 bool isXOnly = cmdMediator->document().isXOnly (pointIdentifier);
192
193 // Ask user for coordinates
194 double x = posGraphBefore.x();
195 double y = posGraphBefore.y();
196
197 DlgEditPointAxis *dlg = new DlgEditPointAxis (context().mainWindow(),
198 cmdMediator->document().modelCoords(),
199 cmdMediator->document().modelGeneral(),
200 context().mainWindow().modelMainWindow(),
201 context().mainWindow().transformation(),
202 cmdMediator->document().documentAxesPointsRequired(),
203 isXOnly,
204 &x,
205 &y);
206 int rtn = dlg->exec ();
207
208 QPointF posGraphAfter = dlg->posGraph (isXOnly); // This call returns new values for isXOnly and the graph position
209 delete dlg;
210
211 if (rtn == QDialog::Accepted) {
212
213 // User wants to edit this axis point, but let's perform sanity checks first
214
215 bool isError;
216 QString errorMessage;
217
219 posScreen,
220 posGraphAfter,
221 isError,
222 errorMessage);
223
224 if (isError) {
225
226 QMessageBox::warning (nullptr,
228 errorMessage);
229
230 } else {
231
232 // Create a command to edit the point
233 CmdEditPointAxis *cmd = new CmdEditPointAxis (context().mainWindow(),
234 cmdMediator->document(),
235 pointIdentifier,
236 posGraphBefore,
237 posGraphAfter,
238 isXOnly);
239 context().appendNewCmd(cmdMediator,
240 cmd);
241 }
242 }
243}
244
246 const QStringList &pointIdentifiers)
247{
248 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventGraph "
249 << "points=" << pointIdentifiers.join(",").toLatin1 ().data ();
250
251 // Editing graph coordinates before the axes are defined is not useful because:
252 // 1) That functionality is for fine tuning point placement based on defined axes
253 // 2) The transformation from screen to graph coordinates below will crash
254 if (context().mainWindow().transformation().transformIsDefined()) {
255
256 double *x = nullptr, *y = nullptr;
257
258 if (pointIdentifiers.count() == 1) {
259
260 // There is exactly one point so pass its coordinates to the dialog
261 x = new double;
262 y = new double;
263
264 QPointF posScreenBefore = cmdMediator->document().positionScreen (pointIdentifiers.first());
265 QPointF posGraphBefore;
267 posGraphBefore);
268
269 // Ask user for coordinates
270 *x = posGraphBefore.x();
271 *y = posGraphBefore.y();
272 }
273
274 DlgEditPointGraph *dlg = new DlgEditPointGraph (context().mainWindow(),
275 cmdMediator->document().modelCoords(),
276 cmdMediator->document().modelGeneral(),
277 context().mainWindow().modelMainWindow(),
278 context().mainWindow().transformation(),
279 x,
280 y);
281 delete x;
282 delete y;
283
284 x = nullptr;
285 y = nullptr;
286
287 int rtn = dlg->exec ();
288
289 bool isXGiven, isYGiven;
290 double xGiven, yGiven;
291 dlg->posGraph (isXGiven, xGiven, isYGiven, yGiven); // One or both coordinates are returned
292 delete dlg;
293
294 if (rtn == QDialog::Accepted) {
295
296 // Create a command to edit the point
297 CmdEditPointGraph *cmd = new CmdEditPointGraph (context().mainWindow(),
298 cmdMediator->document(),
299 pointIdentifiers,
300 isXGiven,
301 isYGiven,
302 xGiven,
303 yGiven);
304 context().appendNewCmd(cmdMediator,
305 cmd);
306 }
307 }
308}
309
311{
312 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleCurveChange";
313}
314
316 Qt::Key key,
317 bool atLeastOneSelectedItem)
318{
319 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleKeyPress"
320 << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
321
322 if (atLeastOneSelectedItem) {
323
324 if (key == Qt::Key_Down ||
325 key == Qt::Key_Up ||
326 key == Qt::Key_Left ||
327 key == Qt::Key_Right) {
328
329 keyPressArrow (cmdMediator,
330 key);
331
332 }
333 }
334}
335
337 QPointF /* posScreen */)
338{
339// LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleMouseMove";
340}
341
343 QPointF posScreen)
344{
345 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleMousePress"
346 << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ();
347
348 // Note that GraphicsView has already called GraphicsPointAbstract::resetPositionHasChanged on all items
349
350 m_movingStart = posScreen;
351}
352
354 QPointF posScreen)
355{
356 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleMouseRelease"
357 << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ();
358
359 QPointF deltaScreen = posScreen - m_movingStart;
360 QStringList positionHasChangedIdentifers = context().mainWindow().scene().positionHasChangedPointIdentifiers();
361
362 bool positionHasChanged = (positionHasChangedIdentifers.count () > 0);
363
364 if (positionHasChanged && (
365 qAbs (deltaScreen.x ()) > 0 ||
366 qAbs (deltaScreen.y ()) > 0)) {
367
368 QString moveText = moveTextFromDeltaScreen (deltaScreen);
369
370 // Create command to move points
371 CmdMoveBy *cmd = new CmdMoveBy (context().mainWindow(),
372 cmdMediator->document(),
373 deltaScreen,
374 moveText,
375 positionHasChangedIdentifers);
376 context().appendNewCmd (cmdMediator,
377 cmd);
378
379 } else {
380
381 // Selection probably changed so update the MainWindow controls (especially Cut)
383
384 showCoordinatesIfSinglePointIsSelected ();
385 }
386}
387
388void DigitizeStateSelect::keyPressArrow (CmdMediator *cmdMediator,
389 Qt::Key key)
390{
391 QPointF deltaScreen;
392 QString moveText;
393 switch (key) {
394 case Qt::Key_Down:
395 deltaScreen = QPointF (0, zoomedToUnzoomedScreenY ());
396 moveText = MOVE_TEXT_DOWN;
397 break;
398
399 case Qt::Key_Left:
400 deltaScreen = QPointF (-1 * zoomedToUnzoomedScreenX (), 0);
401 moveText = MOVE_TEXT_LEFT;
402 break;
403
404 case Qt::Key_Right:
405 deltaScreen = QPointF (zoomedToUnzoomedScreenX (), 0);
406 moveText = MOVE_TEXT_RIGHT;
407 break;
408
409 case Qt::Key_Up:
410 deltaScreen = QPointF (0, -1 * zoomedToUnzoomedScreenY ());
411 moveText = MOVE_TEXT_UP;
412 break;
413
414 default:
415 ENGAUGE_ASSERT (false);
416 }
417
418 // Create command to move points
419 GraphicsItemsExtractor graphicsItemsExtractor;
420 const QList<QGraphicsItem*> &items = context().mainWindow().scene ().selectedItems();
421 CmdMoveBy *cmd = new CmdMoveBy (context().mainWindow(),
422 cmdMediator->document(),
423 deltaScreen,
424 moveText,
425 graphicsItemsExtractor.selectedPointIdentifiers (items));
426 context().appendNewCmd (cmdMediator,
427 cmd);
428}
429
430QString DigitizeStateSelect::moveTextFromDeltaScreen (const QPointF &deltaScreen)
431{
432 QString moveText;
433
434 // x UP x -----> +x
435 // x x |
436 // LEFT x RIGHT |
437 // x x v
438 // x DOWN x +y
439 bool downOrRight = (deltaScreen.y () > -1.0 * deltaScreen.x ());
440 bool upOrRight = (deltaScreen.y () < deltaScreen.x ());
441 if (downOrRight && upOrRight) {
442 moveText = MOVE_TEXT_RIGHT;
443 } else if (downOrRight && !upOrRight) {
444 moveText = MOVE_TEXT_DOWN;
445 } else if (!downOrRight && upOrRight) {
446 moveText = MOVE_TEXT_UP;
447 } else {
448 moveText = MOVE_TEXT_LEFT;
449 }
450
451 return moveText;
452}
453
454void DigitizeStateSelect::removeHoverHighlighting()
455{
456 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::removeHoverHighlighting";
457
458 QList<QGraphicsItem*> items = context().mainWindow().scene().items();
459 QList<QGraphicsItem*>::iterator itr;
460 for (itr = items.begin (); itr != items.end (); itr++) {
461
462 QGraphicsItem *item = *itr;
465 item->setAcceptHoverEvents(false);
466 }
467 }
468}
469
470double DigitizeStateSelect::scaleBarLength (CmdMediator *cmdMediator) const
471{
472 CallbackScaleBar ftor;
473
474 Functor2wRet<const QString &, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
476 cmdMediator->iterateThroughCurvePointsAxes (ftorWithCallback);
477
478 return ftor.scaleBarLength ();
479}
480
481QString DigitizeStateSelect::scaleBarPointIdentifier (CmdMediator *cmdMediator) const
482{
483 CallbackScaleBar ftor;
484
485 Functor2wRet<const QString &, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
487 cmdMediator->iterateThroughCurvePointsAxes (ftorWithCallback);
488
489 return ftor.scaleBarPointIdentifier();
490}
491
492void DigitizeStateSelect::setHoverHighlighting(const MainWindowModel &modelMainWindow)
493{
494 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::addHoverHighlighting";
495
496 // Set the opacity for all points. It should be already set for pre-existing points
497 QList<QGraphicsItem*> items = context().mainWindow().scene().items();
498 QList<QGraphicsItem*>::iterator itr;
499 for (itr = items.begin (); itr != items.end (); itr++) {
500
501 QGraphicsItem *item = *itr;
503 item->setOpacity (modelMainWindow.highlightOpacity());
504 }
505 }
506}
507
508void DigitizeStateSelect::showCoordinatesIfSinglePointIsSelected ()
509{
510 // See if there is a single point selected
511 QList<QGraphicsItem*> items = context().mainWindow().scene().selectedItems();
512 if (items.size () == 1) {
513
514 // There is a single item selected but we must see if it is a point
515 QGraphicsItem *item = * (items.begin ());
516
518
519 // Show the coordinates of the point in the status bar
520 QString coordsScreen, coordsGraph, resolutionGraph;
522 coordsScreen,
523 coordsGraph,
524 resolutionGraph,
525 context().mainWindow().modeMap());
526
527 context().mainWindow().showTemporaryMessage(coordsGraph);
528 }
529 }
530}
531
533{
534 return "DigitizeStateSelect";
535}
536
538{
539 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateAfterPointAddition";
540
541 addHoverHighlighting ();
542}
543
545 const DocumentModelDigitizeCurve & /*modelDigitizeCurve */)
546{
547 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateModelDigitizeCurve";
548}
549
551{
552 LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateModelSegments";
553}
554
555double DigitizeStateSelect::zoomedToUnzoomedScreenX () const
556{
557 double m11 = context().mainWindow ().view ().transform().m11 ();
558 return 1.0 / m11;
559}
560
561double DigitizeStateSelect::zoomedToUnzoomedScreenY () const
562{
563 double m22 = context().mainWindow ().view ().transform().m22 ();
564 return 1.0 / m22;
565}
@ DATA_KEY_GRAPHICS_ITEM_TYPE
Definition DataKey.h:15
DigitizeState
Set of possible states of Digitize toolbar.
const QString MOVE_TEXT_UP(QObject::tr("Move up"))
const QString MOVE_TEXT_DOWN(QObject::tr("Move down"))
const QString MOVE_TEXT_LEFT(QObject::tr("Move left"))
const QString MOVE_TEXT_RIGHT(QObject::tr("Move right"))
@ DOCUMENT_AXES_POINTS_REQUIRED_2
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
@ GRAPHICS_ITEM_TYPE_GUIDELINE
@ GRAPHICS_ITEM_TYPE_POINT
log4cpp::Category * mainCat
Definition Logger.cpp:14
QString QPointFToString(const QPointF &pos)
QString engaugeWindowTitle()
Text for title bars of dialogs.
Definition Version.cpp:14
QString scaleBarPointIdentifier() const
Identified axis point.
double scaleBarLength() const
Length of scale bar.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Command for editing the graph coordinates of one or more graph points.
Command queue stack.
Definition CmdMediator.h:24
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Command for moving all selected Points by a specified translation.
Definition CmdMoveBy.h:19
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
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 setDragMode(QGraphicsView::DragMode dragMode)
Set QGraphicsView drag mode (in m_view). Called from DigitizeStateAbstractBase subclasses.
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
virtual bool canPaste(const Transformation &transformation, const QSize &viewSize) const
Return true if there is good data in the clipboard for pasting, and that is compatible with the curre...
virtual void updateAfterPointAddition()
Update graphics attributes after possible new points. This is useful for highlight opacity.
virtual void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
Handle a right click, on a graph point, that was intercepted earlier.
virtual bool guidelinesAreSelectable() const
Enable/disable guidelines according to state.
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.
virtual void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
virtual void handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click, on an axis point, that was intercepted earlier.
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
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...
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
DigitizeStateSelect(DigitizeStateContext &context)
Single constructor.
virtual QString state() const
State name for debugging.
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted.
Dialog box for editing the information of one or more points.
void posGraph(bool &isX, double &x, bool &isY, double &y) const
Return one or both coordinates. Only applies if dialog was accepted.
Dialog box for editing the information of the map scale.
double scaleLength() const
Return the scale bar length specified by the user. Only applies if dialog was accepted.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsSegments and CmdSettingsSegments.
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
Definition Document.cpp:837
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
Definition Document.cpp:726
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
Definition Document.cpp:832
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Definition Document.cpp:447
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition Document.cpp:698
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
Definition Document.cpp:287
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition Document.cpp:366
QStringList selectedPointIdentifiers(const QList< QGraphicsItem * > &items) const
Return list of selected point identifiers.
QStringList positionHasChangedPointIdentifiers() const
Return a list of identifiers for the points that have moved since the last call to resetPositionHasCh...
Model for DlgSettingsMainWindow.
double highlightOpacity() const
Get method for highlight opacity.
void showTemporaryMessage(const QString &temporaryMessage)
Show temporary message in status bar.
CmdMediator * cmdMediator()
Accessor for commands to process the Document.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
void handleGuidelinesActiveChange(bool active)
Handle Guidelines active status toggle.
QString selectedGraphCurve() const
Curve name that is currently selected in m_cmbCurve.
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
void updateAfterMouseRelease()
Call MainWindow::updateControls (which is private) after the very specific case - a mouse press/relea...
Transformation transformation() const
Return read-only copy of transformation.
GraphicsView & view()
View for the QImage and QGraphicsItems, without const.
Affine transformation between screen and graph coordinates, based on digitized axis points.
void coordTextForStatusBar(QPointF cursorScreen, QString &coordsScreen, QString &coordsGraph, QString &resolutionGraph, bool usingScaleBar)
Return string descriptions of cursor coordinates for status bar.
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20