Engauge Digitizer  2
DlgEditPoint.h
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 #ifndef DLG_EDIT_POINT_H
8 #define DLG_EDIT_POINT_H
9 
10 #include "CoordUnitsDate.h"
11 #include "CoordUnitsNonPolarTheta.h"
12 #include "CoordUnitsPolarTheta.h"
13 #include "CoordUnitsTime.h"
14 #include "DocumentAxesPointsRequired.h"
15 #include <QCursor>
16 #include <QDialog>
17 #include <QLineEdit>
18 #include <QPushButton>
19 
23 class MainWindow;
24 class MainWindowModel;
25 class QDoubleValidator;
26 class QVBoxLayout;
27 class Transformation;
28 
30 class DlgEditPoint : public QDialog
31 {
32  Q_OBJECT;
33 
34 public:
37  DlgEditPoint (MainWindow &mainWindow,
38  DigitizeStateAbstractBase &digitizeState,
39  const DocumentModelCoords &modelCoords,
40  const MainWindowModel &modelMainWindow,
41  const QCursor &cursorShape,
42  const Transformation &transformation,
43  DocumentAxesPointsRequired documentAxesPointsRequired,
44  bool isXOnly = false,
45  const double *xInitialValue = 0,
46  const double *yInitialValue = 0);
47  ~DlgEditPoint ();
48 
50  QPointF posGraph (bool &isXOnly) const;
51 
52 signals:
54  void signalSetOverrideCursor (QCursor);
55 
56 private slots:
57  void slotTextChanged (const QString &);
58 
59 private:
60  void createCoords (QVBoxLayout *layoutOuter);
61  void createOkCancel (QVBoxLayout *layoutOuter);
62  void initializeGraphCoordinates (const double *xInitialValue,
63  const double *yInitialValue,
64  const Transformation &transformation,
65  bool isX,
66  bool isY);
67  bool isCartesian () const;
68  QChar nameXTheta () const;
69  QChar nameYRadius () const;
70  QString unitsType (bool isXTheta) const;
71  void updateControls ();
72 
73  QCursor m_cursorShape;
74  QLineEdit *m_editGraphX;
75  DlgValidatorAbstract *m_validatorGraphX;
76  QLineEdit *m_editGraphY;
77  DlgValidatorAbstract *m_validatorGraphY;
78  QPushButton *m_btnOk;
79  QPushButton *m_btnCancel;
80 
81  DocumentAxesPointsRequired m_documentAxesPointsRequired;
82 
83  const DocumentModelCoords &m_modelCoords;
84  const MainWindowModel &m_modelMainWindow;
85 };
86 
87 #endif // DLG_EDIT_POINT_H
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted...
Abstract validator for all numeric formats.
void signalSetOverrideCursor(QCursor)
Send a signal to trigger the setting of the override cursor.
DlgEditPoint(MainWindow &mainWindow, DigitizeStateAbstractBase &digitizeState, const DocumentModelCoords &modelCoords, const MainWindowModel &modelMainWindow, const QCursor &cursorShape, const Transformation &transformation, DocumentAxesPointsRequired documentAxesPointsRequired, bool isXOnly=false, const double *xInitialValue=0, const double *yInitialValue=0)
Constructor for existing point which already has graph coordinates (which may be changed using this d...
Affine transformation between screen and graph coordinates, based on digitized axis points...
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
Dialog box for editing the information of one axis point.
Definition: DlgEditPoint.h:30
Base class for all digitizing states. This serves as an interface to DigitizeStateContext.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:77