Seamly2D
Code documentation
dialogarcwithlength.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file dialogarcwithlength.h
3  ** @author Douglas S Caskey
4  ** @date 21 Mar, 2023
5  **
6  ** @brief
7  ** @copyright
8  ** This source code is part of the Seamly2D project, a pattern making
9  ** program to create and model patterns of clothing.
10  ** Copyright (C) 2017-2023 Seamly2D project
11  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12  **
13  ** Seamly2D is free software: you can redistribute it and/or modify
14  ** You should have received a copy of the GNU General Public License
15  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
16  **
17  *****************************************************************************/
18 
19 /************************************************************************
20  **
21  ** @file dialogarcwithlength.h
22  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
23  ** @date 9 6, 2015
24  **
25  ** @brief
26  ** @copyright
27  ** This source code is part of the Valentine project, a pattern making
28  ** program, whose allow create and modeling patterns of clothing.
29  ** Copyright (C) 2015 Seamly2D project
30  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
31  **
32  ** Seamly2D is free software: you can redistribute it and/or modify
33  ** it under the terms of the GNU General Public License as published by
34  ** the Free Software Foundation, either version 3 of the License, or
35  ** (at your option) any later version.
36  **
37  ** Seamly2D is distributed in the hope that it will be useful,
38  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
39  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40  ** GNU General Public License for more details.
41  **
42  ** You should have received a copy of the GNU General Public License
43  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
44  **
45  *************************************************************************/
46 
47 #ifndef DIALOGARCWITHLENGTH_H
48 #define DIALOGARCWITHLENGTH_H
49 
50 #include <qcompilerdetection.h>
51 #include <QMetaObject>
52 #include <QObject>
53 #include <QString>
54 #include <QtGlobal>
55 
56 #include "dialogtool.h"
57 #include "../vgeometry/varc.h"
58 #include "../vmisc/def.h"
59 
60 namespace Ui
61 {
62  class DialogArcWithLength;
63 }
64 
66 {
67  Q_OBJECT
68 
69 public:
70  DialogArcWithLength(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
72 
73  VArc getArc() const;
74  void setArc(const VArc &arc);
75 
76  quint32 GetCenter() const;
77  void SetCenter(const quint32 &value);
78 
79  QString GetRadius() const;
80  void SetRadius(const QString &value);
81 
82  QString GetF1() const;
83  void SetF1(const QString &value);
84 
85  QString GetLength() const;
86  void SetLength(const QString &value);
87 
88  QString getPenStyle() const;
89  void setPenStyle(const QString &value);
90 
91  QString getLineWeight() const;
92  void setLineWeight(const QString &value);
93 
94  QString getLineColor() const;
95  void setLineColor(const QString &value);
96 
97 public slots:
98  virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
99  /**
100  * @brief DeployFormulaTextEdit grow or shrink formula input
101  */
102  void DeployRadiusTextEdit();
103  void DeployF1TextEdit();
104  void DeployLengthTextEdit();
105 
106  void RadiusChanged();
107  void F1Changed();
108  void LengthChanged();
109 
110  void FXRadius();
111  void FXF1();
112  void FXLength();
113 
114 protected:
115  void pointNameChanged();
116  virtual void CheckState() Q_DECL_FINAL;
117  virtual void ShowVisualization() Q_DECL_OVERRIDE;
118  /**
119  * @brief SaveData Put dialog data in local variables
120  */
121  virtual void SaveData() Q_DECL_OVERRIDE;
122  virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
123 
124 private:
125  Q_DISABLE_COPY(DialogArcWithLength)
127 
128  /** @brief flagRadius true if value of radius is correct */
130 
131  /** @brief flagF1 true if value of first angle is correct */
132  bool flagF1;
133 
135 
136  /** @brief timerRadius timer of check formula of radius */
137  QTimer *timerRadius;
138 
139  /** @brief timerF1 timer of check formula of first angle */
140  QTimer *timerF1;
141 
142  QTimer *timerLength;
143 
144  /** @brief radius formula of radius */
145  QString radius;
146 
147  /** @brief f1 formula of first angle */
148  QString f1;
149 
150  QString length;
151 
152  /** @brief formulaBaseHeight base height defined by dialogui */
156 
157  qreal angleF1;
159  qint32 m_Id;
160  qint32 newDuplicate;
161 
162  void Radius();
163  void Length();
164  void EvalF();
165 };
166 
167 #endif // DIALOGARCWITHLENGTH_H
QTimer * timerF1
timerF1 timer of check formula of first angle
void setArc(const VArc &arc)
virtual void ShowVisualization() Q_DECL_OVERRIDE
QString radius
radius formula of radius
DialogArcWithLength(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
bool flagF1
flagF1 true if value of first angle is correct
void SetF1(const QString &value)
void setLineColor(const QString &value)
bool flagRadius
flagRadius true if value of radius is correct
void setPenStyle(const QString &value)
QString getLineWeight() const
getLineWeight return weight of the lines
void SetRadius(const QString &value)
int formulaBaseHeightRadius
formulaBaseHeight base height defined by dialogui
QTimer * timerRadius
timerRadius timer of check formula of radius
void SetLength(const QString &value)
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
Ui::DialogArcWithLength * ui
void SetCenter(const quint32 &value)
QString f1
f1 formula of first angle
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
void DeployRadiusTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
QString getLineColor() const
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
The DialogTool class parent for all dialog of tools.
Definition: dialogtool.h:107
quint32 toolId
Definition: dialogtool.h:225
const VContainer * data
data container with data
Definition: dialogtool.h:177
VArc class for anticlockwise arc.
Definition: varc.h:74
The VContainer class container of all variables.
Definition: vcontainer.h:141
SceneObject
Definition: def.h:103