Engauge Digitizer  2
DlgEditPointAxis.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_AXIS_H
8 #define DLG_EDIT_POINT_AXIS_H
9 
10 #include "DocumentAxesPointsRequired.h"
11 #include <QDialog>
12 #include <QLineEdit>
13 #include <QPushButton>
14 
18 class MainWindow;
19 class MainWindowModel;
20 class QVBoxLayout;
21 class Transformation;
22 
24 class DlgEditPointAxis : public QDialog
25 {
26  Q_OBJECT;
27 
28 public:
31  DlgEditPointAxis (MainWindow &mainWindow,
32  const DocumentModelCoords &modelCoords,
33  const DocumentModelGeneral &modelGeneral,
34  const MainWindowModel &modelMainWindow,
35  const Transformation &transformation,
36  DocumentAxesPointsRequired documentAxesPointsRequired,
37  bool isXOnly = false,
38  const double *xInitialValue = 0,
39  const double *yInitialValue = 0);
40  ~DlgEditPointAxis ();
41 
43  QPointF posGraph (bool &isXOnly) const;
44 
45 private slots:
46  void slotTextChanged (const QString &);
47 
48 private:
49  void createCoords (QVBoxLayout *layoutOuter);
50  void createHint (QVBoxLayout *layoutOuter);
51  void createOkCancel (QVBoxLayout *layoutOuter);
52  void initializeGraphCoordinates (const double *xInitialValue,
53  const double *yInitialValue,
54  const Transformation &transformation,
55  bool isX,
56  bool isY);
57  bool isCartesian () const;
58  QChar nameXTheta () const;
59  QChar nameYRadius () const;
60  QString unitsType (bool isXTheta) const;
61  void updateControls ();
62 
63  QLineEdit *m_editGraphX;
64  DlgValidatorAbstract *m_validatorGraphX;
65  QLineEdit *m_editGraphY;
66  DlgValidatorAbstract *m_validatorGraphY;
67  QPushButton *m_btnOk;
68  QPushButton *m_btnCancel;
69 
70  DocumentAxesPointsRequired m_documentAxesPointsRequired;
71 
72  const DocumentModelCoords &m_modelCoords;
73  const DocumentModelGeneral &m_modelGeneral;
74  const MainWindowModel &m_modelMainWindow;
75 };
76 
77 #endif // DLG_EDIT_POINT_AXIS_H
Dialog box for editing the information of one axis point, in a graph with two axes.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Abstract validator for all numeric formats.
DlgEditPointAxis(MainWindow &mainWindow, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, 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...
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted...
Affine transformation between screen and graph coordinates, based on digitized axis points...
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89