Engauge Digitizer  2
 All Classes Functions Variables Typedefs Enumerations Friends Pages
DigitizeStateSelect.cpp
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"
13 #include "DigitizeStateContext.h"
14 #include "DigitizeStateSelect.h"
15 #include "DlgEditPointAxis.h"
16 #include "DlgEditPointGraph.h"
17 #include "DlgEditScale.h"
18 #include "EngaugeAssert.h"
19 #include "GraphicsItemsExtractor.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 
35 const QString MOVE_TEXT_DOWN (QObject::tr ("Move down"));
36 const QString MOVE_TEXT_LEFT (QObject::tr ("Move left"));
37 const QString MOVE_TEXT_RIGHT (QObject::tr ("Move right"));
38 const QString MOVE_TEXT_UP (QObject::tr ("Move up"));
39 
42 {
43 }
44 
45 DigitizeStateSelect::~DigitizeStateSelect ()
46 {
47 }
48 
50 {
52 }
53 
54 void 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;
63  if (item->data (DATA_KEY_GRAPHICS_ITEM_TYPE) == GRAPHICS_ITEM_TYPE_POINT) {
64  item->setAcceptHoverEvents(true);
65  }
66  }
67 }
68 
70  DigitizeState /* previousState */)
71 {
72  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::begin";
73 
74  setCursor(cmdMediator);
75  context().setDragMode(QGraphicsView::RubberBandDrag);
76 
77  addHoverHighlighting();
79 }
80 
81 bool DigitizeStateSelect::canPaste (const Transformation & /* transformation */,
82  const QSize & /* viewSize */) const
83 {
84  return false;
85 }
86 
87 QCursor DigitizeStateSelect::cursor(CmdMediator * /* cmdMediator */) const
88 {
89  LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::cursor";
90 
91  return QCursor (Qt::ArrowCursor);
92 }
93 
95 {
96  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::end";
97 
98  removeHoverHighlighting();
99 }
100 
102  const QString &pointIdentifier)
103 {
104  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis "
105  << " point=" << pointIdentifier.toLatin1 ().data ();
106 
107  if (cmdMediator->document().documentAxesPointsRequired() == DOCUMENT_AXES_POINTS_REQUIRED_2) {
108  handleContextMenuEventAxis2 (cmdMediator);
109  } else {
110  handleContextMenuEventAxis34 (cmdMediator,
111  pointIdentifier);
112  }
113 }
114 
115 void DigitizeStateSelect::handleContextMenuEventAxis2 (CmdMediator *cmdMediator)
116 {
117  LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis2";
118 
119  const bool IS_NOT_X_ONLY = false;
120 
121  // The point identifier we want is not necessarily the one edited but is the one with the
122  // nonzero x or y (but not both) coordinate
123  QString pointIdentifier = scaleBarPointIdentifier (cmdMediator);
124 
125  QPointF posScreen = cmdMediator->document().positionScreen (pointIdentifier);
126  QPointF posGraphBefore = cmdMediator->document().positionGraph (pointIdentifier);
127 
128  // Ask user for scale length
129  double scaleLength = scaleBarLength (cmdMediator);
130  DlgEditScale *dlg = new DlgEditScale (context().mainWindow(),
131  cmdMediator->document().modelCoords(),
132  cmdMediator->document().modelGeneral(),
134  &scaleLength);
135  int rtn = dlg->exec ();
136 
137  scaleLength = dlg->scaleLength (); // This call returns new value for scale length
138  delete dlg;
139 
140  if (rtn == QDialog::Accepted) {
141 
142  // User wants to edit the scale length, which is effectively editing this axis point, but let's perform sanity checks first
143 
144  bool isError;
145  QString errorMessage;
146 
147  bool isXNonzero = (posGraphBefore.x() != 0); // Identify which coordinate is to be edited
148  QPointF posGraphAfter (isXNonzero ? scaleLength : 0,
149  isXNonzero ? 0 : scaleLength);
150  context().mainWindow().cmdMediator()->document().checkEditPointAxis(pointIdentifier,
151  posScreen,
152  posGraphAfter,
153  isError,
154  errorMessage);
155 
156  if (isError) {
157 
158  QMessageBox::warning (0,
159  engaugeWindowTitle(),
160  errorMessage);
161 
162  } else {
163 
164  // Create a command to change the scale length
165  CmdEditPointAxis *cmd = new CmdEditPointAxis (context().mainWindow(),
166  cmdMediator->document(),
167  pointIdentifier,
168  posGraphBefore,
169  posGraphAfter,
170  IS_NOT_X_ONLY);
171  context().appendNewCmd(cmdMediator,
172  cmd);
173  }
174  }
175 }
176 
177 void DigitizeStateSelect::handleContextMenuEventAxis34 (CmdMediator *cmdMediator,
178  const QString &pointIdentifier)
179 {
180  LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventAxis34";
181 
182  QPointF posScreen = cmdMediator->document().positionScreen (pointIdentifier);
183  QPointF posGraphBefore = cmdMediator->document().positionGraph (pointIdentifier);
184  bool isXOnly = cmdMediator->document().isXOnly (pointIdentifier);
185 
186  // Ask user for coordinates
187  double x = posGraphBefore.x();
188  double y = posGraphBefore.y();
189 
190  DlgEditPointAxis *dlg = new DlgEditPointAxis (context().mainWindow(),
191  cmdMediator->document().modelCoords(),
192  cmdMediator->document().modelGeneral(),
195  cmdMediator->document().documentAxesPointsRequired(),
196  isXOnly,
197  &x,
198  &y);
199  int rtn = dlg->exec ();
200 
201  QPointF posGraphAfter = dlg->posGraph (isXOnly); // This call returns new values for isXOnly and the graph position
202  delete dlg;
203 
204  if (rtn == QDialog::Accepted) {
205 
206  // User wants to edit this axis point, but let's perform sanity checks first
207 
208  bool isError;
209  QString errorMessage;
210 
211  context().mainWindow().cmdMediator()->document().checkEditPointAxis(pointIdentifier,
212  posScreen,
213  posGraphAfter,
214  isError,
215  errorMessage);
216 
217  if (isError) {
218 
219  QMessageBox::warning (0,
220  engaugeWindowTitle(),
221  errorMessage);
222 
223  } else {
224 
225  // Create a command to edit the point
226  CmdEditPointAxis *cmd = new CmdEditPointAxis (context().mainWindow(),
227  cmdMediator->document(),
228  pointIdentifier,
229  posGraphBefore,
230  posGraphAfter,
231  isXOnly);
232  context().appendNewCmd(cmdMediator,
233  cmd);
234  }
235  }
236 }
237 
239  const QStringList &pointIdentifiers)
240 {
241  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleContextMenuEventGraph "
242  << "points=" << pointIdentifiers.join(",").toLatin1 ().data ();
243 
244  double *x = 0, *y = 0;
245 
246  if (pointIdentifiers.count() == 1) {
247 
248  // There is exactly one point so pass its coordinates to the dialog
249  x = new double;
250  y = new double;
251 
252  QPointF posScreenBefore = cmdMediator->document().positionScreen (pointIdentifiers.first());
253  QPointF posGraphBefore;
255  posGraphBefore);
256 
257  // Ask user for coordinates
258  *x = posGraphBefore.x();
259  *y = posGraphBefore.y();
260  }
261 
262  DlgEditPointGraph *dlg = new DlgEditPointGraph (context().mainWindow(),
263  cmdMediator->document().modelCoords(),
264  cmdMediator->document().modelGeneral(),
267  x,
268  y);
269  delete x;
270  delete y;
271 
272  x = 0;
273  y = 0;
274 
275  int rtn = dlg->exec ();
276 
277  bool isXGiven, isYGiven;
278  double xGiven, yGiven;
279  dlg->posGraph (isXGiven, xGiven, isYGiven, yGiven); // One or both coordinates are returned
280  delete dlg;
281 
282  if (rtn == QDialog::Accepted) {
283 
284  // Create a command to edit the point
285  CmdEditPointGraph *cmd = new CmdEditPointGraph (context().mainWindow(),
286  cmdMediator->document(),
287  pointIdentifiers,
288  isXGiven,
289  isYGiven,
290  xGiven,
291  yGiven);
292  context().appendNewCmd(cmdMediator,
293  cmd);
294  }
295 }
296 
298 {
299  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleCurveChange";
300 }
301 
303  Qt::Key key,
304  bool atLeastOneSelectedItem)
305 {
306  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleKeyPress"
307  << " key=" << QKeySequence (key).toString ().toLatin1 ().data ();
308 
309  if (atLeastOneSelectedItem) {
310 
311  if (key == Qt::Key_Down ||
312  key == Qt::Key_Up ||
313  key == Qt::Key_Left ||
314  key == Qt::Key_Right) {
315 
316  keyPressArrow (cmdMediator,
317  key);
318 
319  }
320  }
321 }
322 
324  QPointF /* posScreen */)
325 {
326 // LOG4CPP_DEBUG_S ((*mainCat)) << "DigitizeStateSelect::handleMouseMove";
327 }
328 
330  QPointF posScreen)
331 {
332  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleMousePress"
333  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ();
334 
335  // Note that GraphicsView has already called GraphicsPointAbstract::resetPositionHasChanged on all items
336 
337  m_movingStart = posScreen;
338 }
339 
341  QPointF posScreen)
342 {
343  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::handleMouseRelease"
344  << " posScreen=" << QPointFToString (posScreen).toLatin1 ().data ();
345 
346  QPointF deltaScreen = posScreen - m_movingStart;
347  QStringList positionHasChangedIdentifers = context().mainWindow().scene().positionHasChangedPointIdentifiers();
348 
349  bool positionHasChanged = (positionHasChangedIdentifers.count () > 0);
350 
351  if (positionHasChanged && (
352  deltaScreen.x () != 0 ||
353  deltaScreen.y () != 0)) {
354 
355  QString moveText = moveTextFromDeltaScreen (deltaScreen);
356 
357  // Create command to move points
358  CmdMoveBy *cmd = new CmdMoveBy (context().mainWindow(),
359  cmdMediator->document(),
360  deltaScreen,
361  moveText,
362  positionHasChangedIdentifers);
363  context().appendNewCmd (cmdMediator,
364  cmd);
365 
366  } else {
367 
368  // Selection probably changed so update the MainWindow controls (especially Cut)
370 
371  showCoordinatesIfSinglePointIsSelected ();
372  }
373 }
374 
375 void DigitizeStateSelect::keyPressArrow (CmdMediator *cmdMediator,
376  Qt::Key key)
377 {
378  QPointF deltaScreen;
379  QString moveText;
380  switch (key) {
381  case Qt::Key_Down:
382  deltaScreen = QPointF (0, zoomedToUnzoomedScreenY ());
383  moveText = MOVE_TEXT_DOWN;
384  break;
385 
386  case Qt::Key_Left:
387  deltaScreen = QPointF (-1 * zoomedToUnzoomedScreenX (), 0);
388  moveText = MOVE_TEXT_LEFT;
389  break;
390 
391  case Qt::Key_Right:
392  deltaScreen = QPointF (zoomedToUnzoomedScreenX (), 0);
393  moveText = MOVE_TEXT_RIGHT;
394  break;
395 
396  case Qt::Key_Up:
397  deltaScreen = QPointF (0, -1 * zoomedToUnzoomedScreenY ());
398  moveText = MOVE_TEXT_UP;
399  break;
400 
401  default:
402  ENGAUGE_ASSERT (false);
403  }
404 
405  // Create command to move points
406  GraphicsItemsExtractor graphicsItemsExtractor;
407  const QList<QGraphicsItem*> &items = context().mainWindow().scene ().selectedItems();
408  CmdMoveBy *cmd = new CmdMoveBy (context().mainWindow(),
409  cmdMediator->document(),
410  deltaScreen,
411  moveText,
412  graphicsItemsExtractor.selectedPointIdentifiers (items));
413  context().appendNewCmd (cmdMediator,
414  cmd);
415 }
416 
417 QString DigitizeStateSelect::moveTextFromDeltaScreen (const QPointF &deltaScreen)
418 {
419  QString moveText;
420 
421  // x UP x -----> +x
422  // x x |
423  // LEFT x RIGHT |
424  // x x v
425  // x DOWN x +y
426  bool downOrRight = (deltaScreen.y () > -1.0 * deltaScreen.x ());
427  bool upOrRight = (deltaScreen.y () < deltaScreen.x ());
428  if (downOrRight && upOrRight) {
429  moveText = MOVE_TEXT_RIGHT;
430  } else if (downOrRight && !upOrRight) {
431  moveText = MOVE_TEXT_DOWN;
432  } else if (!downOrRight && upOrRight) {
433  moveText = MOVE_TEXT_UP;
434  } else {
435  moveText = MOVE_TEXT_LEFT;
436  }
437 
438  return moveText;
439 }
440 
441 void DigitizeStateSelect::removeHoverHighlighting()
442 {
443  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::removeHoverHighlighting";
444 
445  QList<QGraphicsItem*> items = context().mainWindow().scene().items();
446  QList<QGraphicsItem*>::iterator itr;
447  for (itr = items.begin (); itr != items.end (); itr++) {
448 
449  QGraphicsItem *item = *itr;
450  if (item->data (DATA_KEY_GRAPHICS_ITEM_TYPE) == GRAPHICS_ITEM_TYPE_POINT) {
451  item->setAcceptHoverEvents(false);
452  }
453  }
454 }
455 
456 double DigitizeStateSelect::scaleBarLength (CmdMediator *cmdMediator) const
457 {
458  CallbackScaleBar ftor;
459 
460  Functor2wRet<const QString &, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
462  cmdMediator->iterateThroughCurvePointsAxes (ftorWithCallback);
463 
464  return ftor.scaleBarLength ();
465 }
466 
467 QString DigitizeStateSelect::scaleBarPointIdentifier (CmdMediator *cmdMediator) const
468 {
469  CallbackScaleBar ftor;
470 
471  Functor2wRet<const QString &, const Point&, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
473  cmdMediator->iterateThroughCurvePointsAxes (ftorWithCallback);
474 
475  return ftor.scaleBarPointIdentifier();
476 }
477 
478 void DigitizeStateSelect::setHoverHighlighting(const MainWindowModel &modelMainWindow)
479 {
480  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::addHoverHighlighting";
481 
482  // Set the opacity for all points. It should be already set for pre-existing points
483  QList<QGraphicsItem*> items = context().mainWindow().scene().items();
484  QList<QGraphicsItem*>::iterator itr;
485  for (itr = items.begin (); itr != items.end (); itr++) {
486 
487  QGraphicsItem *item = *itr;
488  if (item->data (DATA_KEY_GRAPHICS_ITEM_TYPE) == GRAPHICS_ITEM_TYPE_POINT) {
489  item->setOpacity (modelMainWindow.highlightOpacity());
490  }
491  }
492 }
493 
494 void DigitizeStateSelect::showCoordinatesIfSinglePointIsSelected ()
495 {
496  // See if there is a single point selected
497  QList<QGraphicsItem*> items = context().mainWindow().scene().selectedItems();
498  if (items.size () == 1) {
499 
500  // There is a single item selected but we must see if it is a point
501  QGraphicsItem *item = * (items.begin ());
502 
503  if (item->data (DATA_KEY_GRAPHICS_ITEM_TYPE) == GRAPHICS_ITEM_TYPE_POINT) {
504 
505  // Show the coordinates of the point in the status bar
506  QString coordsScreen, coordsGraph, resolutionGraph;
508  coordsScreen,
509  coordsGraph,
510  resolutionGraph,
511  context().mainWindow().modeMap());
512 
513  context().mainWindow().showTemporaryMessage(coordsGraph);
514  }
515  }
516 }
517 
519 {
520  return "DigitizeStateSelect";
521 }
522 
524 {
525  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateAfterPointAddition";
526 
527  addHoverHighlighting ();
528 }
529 
531  const DocumentModelDigitizeCurve & /*modelDigitizeCurve */)
532 {
533  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateModelDigitizeCurve";
534 }
535 
537 {
538  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStateSelect::updateModelSegments";
539 }
540 
541 double DigitizeStateSelect::zoomedToUnzoomedScreenX () const
542 {
543  double m11 = context().mainWindow ().view ().transform().m11 ();
544  return 1.0 / m11;
545 }
546 
547 double DigitizeStateSelect::zoomedToUnzoomedScreenY () const
548 {
549  double m22 = context().mainWindow ().view ().transform().m22 ();
550  return 1.0 / m22;
551 }
void transformScreenToRawGraph(const QPointF &coordScreen, QPointF &coordGraph) const
Transform from cartesian pixel screen coordinates to cartesian/polar graph coordinates.
Dialog box for editing the information of one axis point, in a graph with two axes.
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
QPointF positionScreen(const QString &pointIdentifier) const
See Curve::positionScreen.
Definition: Document.cpp:823
Callback for identifying, for the scale bar of a map, various quantities.
double scaleBarLength() const
Length of scale bar.
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...
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
Definition: Document.cpp:359
bool isXOnly(const QString &pointIdentifier) const
See Curve::isXOnly.
Definition: Document.cpp:440
virtual void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
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.
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
void updateAfterMouseRelease()
Call MainWindow::updateControls (which is private) after the very specific case - a mouse press/relea...
Dialog box for editing the information of the map scale.
Definition: DlgEditScale.h:22
Command for editing the graph coordinates of one or more graph points.
virtual void handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click, on an axis point, that was intercepted earlier.
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.
bool modeMap() const
True if document scale is set using a scale bar, otherwise using axis points.
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.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
Definition: Document.cpp:691
Command for moving all selected Points by a specified translation.
Definition: CmdMoveBy.h:18
virtual void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
Handle a right click, on a graph point, that was intercepted earlier.
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
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.
Definition: MainWindow.cpp:324
Document & document()
Provide the Document to commands, primarily for undo/redo processing.
Definition: CmdMediator.cpp:72
virtual void updateAfterPointAddition()
Update graphics attributes after possible new points. This is useful for highlight opacity...
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
QStringList selectedPointIdentifiers(const QList< QGraphicsItem * > &items) const
Return list of selected point identifiers.
void checkEditPointAxis(const QString &pointIdentifier, const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage)
Check before calling editPointAxis.
Definition: Document.cpp:280
void showTemporaryMessage(const QString &temporaryMessage)
Show temporary message in status bar.
This class consolidates utility routines that deal with graphics items that are getting extracted fro...
void posGraph(bool &isX, double &x, bool &isY, double &y) const
Return one or both coordinates. Only applies if dialog was accepted.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
GraphicsView & view()
View for the QImage and QGraphicsItems, without const.
Affine transformation between screen and graph coordinates, based on digitized axis points...
QStringList positionHasChangedPointIdentifiers() const
Return a list of identifiers for the points that have moved since the last call to resetPositionHasCh...
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
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...
Model for DlgSettingsMainWindow.
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
QString scaleBarPointIdentifier() const
Identified axis point.
void coordTextForStatusBar(QPointF cursorScreen, QString &coordsScreen, QString &coordsGraph, QString &resolutionGraph, bool usingScaleBar)
Return string descriptions of cursor coordinates for status bar.
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...
QPointF positionGraph(const QString &pointIdentifier) const
See Curve::positionGraph.
Definition: Document.cpp:818
double highlightOpacity() const
Get method for highlight opacity.
DigitizeStateSelect(DigitizeStateContext &context)
Single constructor.
Command queue stack.
Definition: CmdMediator.h:23
Dialog box for editing the information of one or more points.
Model for DlgSettingsSegments and CmdSettingsSegments.
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
virtual QString state() const
State name for debugging.
double scaleLength() const
Return the scale bar length specified by the user. Only applies if dialog was accepted.
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the single axes curve.
Definition: CmdMediator.cpp:87
Command for editing the graph coordinates one axis point.
virtual void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
MainWindowModel modelMainWindow() const
Get method for main window model.
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
Definition: Document.cpp:719