Seamly2D
Code documentation
dialogarc.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file dialogarc.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 dialogarc.h
22  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
23  ** @date November 15, 2013
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) 2013-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 DIALOGARC_H
48 #define DIALOGARC_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 DialogArc;
63 }
64 
65 /**
66  * @brief The DialogArc class dialog for ToolArc. Help create arc and edit option.
67  */
68 class DialogArc : public DialogTool
69 {
70  Q_OBJECT
71 public:
72  DialogArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
73  virtual ~DialogArc() Q_DECL_OVERRIDE;
74 
75  VArc getArc() const;
76  void setArc(const VArc &arc);
77 
78  quint32 getCenter() const;
79  void setCenter(const quint32 &value);
80 
81  QString getRadius() const;
82  void setRadius(const QString &value);
83 
84  QString getF1() const;
85  void setF1(const QString &value);
86 
87  QString getF2() const;
88  void setF2(const QString &value);
89 
90  QString getPenStyle() const;
91  void setPenStyle(const QString &value);
92 
93  QString getLineWeight() const;
94  void setLineWeight(const QString &value);
95 
96  QString getLineColor() const;
97  void setLineColor(const QString &value);
98 
99 public slots:
100  virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
101  /**
102  * @brief DeployFormulaTextEdit grow or shrink formula input
103  */
104  void DeployFormulaTextEdit();
105  void DeployF1TextEdit();
106  void DeployF2TextEdit();
107  void RadiusChanged();
108  void F1Changed();
109  void F2Changed();
110 
111  void FXRadius();
112  void FXF1();
113  void FXF2();
114 
115 protected:
116  void pointNameChanged();
117  virtual void CheckState() Q_DECL_FINAL;
118  virtual void ShowVisualization() Q_DECL_OVERRIDE;
119  /**
120  * @brief SaveData Put dialog data in local variables
121  */
122  virtual void SaveData() Q_DECL_OVERRIDE;
123  virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
124 
125 private:
126  Q_DISABLE_COPY(DialogArc)
127 
128  /** @brief ui keeps information about user interface */
130 
131  /** @brief flagRadius true if value of radius is correct */
133 
134  /** @brief flagF1 true if value of first angle is correct */
135  bool flagF1;
136 
137  /** @brief flagF2 true if value of second angle is correct */
138  bool flagF2;
139 
140  /** @brief timerRadius timer of check formula of radius */
141  QTimer *timerRadius;
142 
143  /** @brief timerF1 timer of check formula of first angle */
144  QTimer *timerF1;
145 
146  /** @brief timerF2 timer of check formula of second angle */
147  QTimer *timerF2;
148 
149  /** @brief radius formula of radius */
150  QString radius;
151 
152  /** @brief f1 formula of first angle */
153  QString f1;
154 
155  /** @brief f2 formula of second angle */
156  QString f2;
157 
158  /** @brief formulaBaseHeight base height defined by dialogui */
162 
163  qreal angleF1;
164  qreal angleF2;
166  qint32 m_Id;
167  qint32 newDuplicate;
168 
169  void EvalRadius();
170  void EvalF();
171  void CheckAngles();
172 };
173 
174 #endif // DIALOGARC_H
The DialogArc class dialog for ToolArc. Help create arc and edit option.
Definition: dialogarc.h:69
QString getLineWeight() const
getLineWeight return weight of the lines
Definition: dialogarc.cpp:255
QString f1
f1 formula of first angle
Definition: dialogarc.h:153
VArc getArc() const
Definition: dialogarc.cpp:193
bool flagF2
flagF2 true if value of second angle is correct
Definition: dialogarc.h:138
void pointNameChanged()
Definition: dialogarc.cpp:461
void EvalF()
EvalF1 calculate value of angle.
Definition: dialogarc.cpp:537
void setLineColor(const QString &value)
Definition: dialogarc.cpp:277
QString getRadius() const
getRadius return formula of radius
Definition: dialogarc.cpp:587
QString getF1() const
getF1 return formula first angle of arc
Definition: dialogarc.cpp:597
bool flagRadius
flagRadius true if value of radius is correct
Definition: dialogarc.h:132
Ui::DialogArc * ui
ui keeps information about user interface
Definition: dialogarc.h:129
void setF1(const QString &value)
setF1 set formula first angle of arc
Definition: dialogarc.cpp:287
void FXF2()
Definition: dialogarc.cpp:447
QString getLineColor() const
Definition: dialogarc.cpp:271
void EvalRadius()
EvalRadius calculate value of radius.
Definition: dialogarc.cpp:516
virtual ~DialogArc() Q_DECL_OVERRIDE
Definition: dialogarc.cpp:187
qint32 m_Id
Definition: dialogarc.h:166
QString getPenStyle() const
Definition: dialogarc.cpp:239
void DeployF1TextEdit()
Definition: dialogarc.cpp:175
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
Definition: dialogarc.cpp:376
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
Definition: dialogarc.cpp:356
bool flagF1
flagF1 true if value of first angle is correct
Definition: dialogarc.h:135
void setPenStyle(const QString &value)
Definition: dialogarc.cpp:245
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
Definition: dialogarc.cpp:332
quint32 getCenter() const
getCenter return id of center point
Definition: dialogarc.cpp:577
void FXRadius()
Definition: dialogarc.cpp:419
void DeployF2TextEdit()
Definition: dialogarc.cpp:181
void FXF1()
Definition: dialogarc.cpp:433
VArc m_arc
Definition: dialogarc.h:165
void setF2(const QString &value)
setF2 set formula second angle of arc
Definition: dialogarc.cpp:221
void F2Changed()
F2Changed after change formula of second angle calculate value and show result.
Definition: dialogarc.cpp:411
void setRadius(const QString &value)
setRadius set formula of radius
Definition: dialogarc.cpp:309
DialogArc(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogArc create dialog.
Definition: dialogarc.cpp:77
qreal angleF2
Definition: dialogarc.h:164
int formulaBaseHeightF2
Definition: dialogarc.h:161
QTimer * timerF1
timerF1 timer of check formula of first angle
Definition: dialogarc.h:144
void setArc(const VArc &arc)
Definition: dialogarc.cpp:199
virtual void ShowVisualization() Q_DECL_OVERRIDE
Definition: dialogarc.cpp:350
void setLineWeight(const QString &value)
setLineWeight set weight of the lines
Definition: dialogarc.cpp:265
QTimer * timerF2
timerF2 timer of check formula of second angle
Definition: dialogarc.h:147
QTimer * timerRadius
timerRadius timer of check formula of radius
Definition: dialogarc.h:141
void F1Changed()
F1Changed after change formula of first angle calculate value and show result.
Definition: dialogarc.cpp:400
qint32 newDuplicate
Definition: dialogarc.h:167
int formulaBaseHeight
formulaBaseHeight base height defined by dialogui
Definition: dialogarc.h:159
void RadiusChanged()
RadiusChanged after change formula of radius calculate value and show result.
Definition: dialogarc.cpp:388
virtual void CheckState() Q_DECL_FINAL
CheckState if all is right enable button ok.
Definition: dialogarc.cpp:504
void setCenter(const quint32 &value)
setCenter set id of center point
Definition: dialogarc.cpp:210
void DeployFormulaTextEdit()
DeployFormulaTextEdit grow or shrink formula input.
Definition: dialogarc.cpp:169
QString radius
radius formula of radius
Definition: dialogarc.h:150
void CheckAngles()
Definition: dialogarc.cpp:549
int formulaBaseHeightF1
Definition: dialogarc.h:160
qreal angleF1
Definition: dialogarc.h:163
QString f2
f2 formula of second angle
Definition: dialogarc.h:156
QString getF2() const
getF2 return formula second angle of arc
Definition: dialogarc.cpp:607
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