Engauge Digitizer 2
Loading...
Searching...
No Matches
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"
12#include "MainWindowModel.h"
13#include <QDialog>
14#include <QPointF>
15#include <QString>
16
19class MainWindow;
20class QPushButton;
21class QVBoxLayout;
22class Transformation;
23
25class DlgEditPointGraph : public QDialog
26{
27 Q_OBJECT;
28
29public:
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
44private slots:
45 void slotTextChanged (const QString &);
46
47private:
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
Adds hover highlighting to QLineEdit.
void posGraph(bool &isX, double &x, bool &isY, double &y) const
Return one or both coordinates. Only applies if dialog was accepted.
DlgEditPointGraph(MainWindow &mainWindow, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const Transformation &transformation, const double *xInitialValue=0, const double *yInitialValue=0)
Constructor for existing point which already has graph coordinates (which may be changed using this d...
Abstract validator for all numeric formats.
Model for DlgSettingsCoords and CmdSettingsCoords.
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Model for DlgSettingsMainWindow.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:95
Affine transformation between screen and graph coordinates, based on digitized axis points.