Engauge Digitizer  2
DlgEditPointGraph.h
Go to the documentation of this file.
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 "DocumentModelCoords.h"
11 #include "DocumentModelGeneral.h"
12 #include "MainWindowModel.h"
13 #include <QDialog>
14 #include <QPointF>
15 #include <QString>
16 
19 class MainWindow;
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
DocumentModelGeneral.h
MainWindowModel.h
DlgEditPointGraphLineEdit
Adds hover highlighting to QLineEdit.
Definition: DlgEditPointGraphLineEdit.h:14
DlgEditPointGraph::~DlgEditPointGraph
~DlgEditPointGraph()
Definition: DlgEditPointGraph.cpp:62
Transformation
Affine transformation between screen and graph coordinates, based on digitized axis points.
Definition: Transformation.h:30
DlgEditPointGraph
Dialog box for editing the information of one or more points.
Definition: DlgEditPointGraph.h:24
MainWindowModel
Model for DlgSettingsMainWindow.
Definition: MainWindowModel.h:29
DocumentModelGeneral
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Definition: DocumentModelGeneral.h:15
MainWindow
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:90
DlgValidatorAbstract
Abstract validator for all numeric formats.
Definition: DlgValidatorAbstract.h:13
DocumentModelCoords
Model for DlgSettingsCoords and CmdSettingsCoords.
Definition: DocumentModelCoords.h:19
DocumentModelCoords.h
DlgEditPointGraph::posGraph
void posGraph(bool &isX, double &x, bool &isY, double &y) const
Return one or both coordinates. Only applies if dialog was accepted.
Definition: DlgEditPointGraph.cpp:219