Engauge Digitizer  2
DlgEditPointGraph.h
1 /******************************************************************************************************
2  * (C) 2016 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_GRAPH_H
8 #define DLG_EDIT_POINT_GRAPH_H
9 
10 #include <QDialog>
11 #include <QPointF>
12 #include <QString>
13 
18 class MainWindow;
19 class MainWindowModel;
20 class QPushButton;
21 class QVBoxLayout;
22 class Transformation;
23 
25 class DlgEditPointGraph : public QDialog
26 {
27  Q_OBJECT;
28 
29 public:
32  DlgEditPointGraph (MainWindow &mainWindow,
33  const DocumentModelCoords &modelCoords,
34  const DocumentModelGeneral &modelGeneral,
35  const MainWindowModel &modelMainWindow,
36  const Transformation &transformation,
37  const double *xInitialValue = 0,
38  const double *yInitialValue = 0);
40 
42  void posGraph (bool &isX, double &x, bool &isY, double &y) const;
43 
44 private slots:
45  void slotTextChanged (const QString &);
46 
47 private:
49 
50  void createCoords (QVBoxLayout *layoutOuter);
51  void createHint (QVBoxLayout *layoutOuter);
52  void createOkCancel (QVBoxLayout *layoutOuter);
53  void initializeGraphCoordinates (const double *xInitialValue,
54  const double *yInitialValue,
55  const Transformation &transformation);
56  bool isCartesian () const;
57  QChar nameXTheta () const;
58  QChar nameYRadius () const;
59  QString unitsType (bool isXTheta) const;
60  void updateControls ();
61 
62  DlgValidatorAbstract *m_validatorGraphX;
63  DlgEditPointGraphLineEdit *m_editGraphX;
64  DlgValidatorAbstract *m_validatorGraphY;
65  DlgEditPointGraphLineEdit *m_editGraphY;
66  QPushButton *m_btnOk;
67  QPushButton *m_btnCancel;
68 
69  // Enable Ok button once text has changed. For simplicity, this is true even when original text is restored
70  bool m_changed;
71 
72  const DocumentModelCoords &m_modelCoords;
73  const DocumentModelGeneral &m_modelGeneral;
74  const MainWindowModel &m_modelMainWindow;
75 };
76 
77 #endif // DLG_EDIT_POINT_GRAPH_H
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Adds hover highlighting to QLineEdit.
Abstract validator for all numeric formats.
Affine transformation between screen and graph coordinates, based on digitized axis points...
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
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 one or more points.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89