Seamly2D
Code documentation
dialogmove.h
Go to the documentation of this file.
1 /***************************************************************************
2  * *
3  * Copyright (C) 2017 Seamly, LLC *
4  * *
5  * https://github.com/fashionfreedom/seamly2d *
6  * *
7  ***************************************************************************
8  **
9  ** Seamly2D is free software: you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation, either version 3 of the License, or
12  ** (at your option) any later version.
13  **
14  ** Seamly2D is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** You should have received a copy of the GNU General Public License
20  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21  **
22  **************************************************************************
23 
24  ************************************************************************
25  **
26  ** @file dialogmove.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 30 9, 2016
29  **
30  ** @brief
31  ** @copyright
32  ** This source code is part of the Valentine project, a pattern making
33  ** program, whose allow create and modeling patterns of clothing.
34  ** Copyright (C) 2016 Seamly2D project
35  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36  **
37  ** Seamly2D is free software: you can redistribute it and/or modify
38  ** it under the terms of the GNU General Public License as published by
39  ** the Free Software Foundation, either version 3 of the License, or
40  ** (at your option) any later version.
41  **
42  ** Seamly2D is distributed in the hope that it will be useful,
43  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
44  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  ** GNU General Public License for more details.
46  **
47  ** You should have received a copy of the GNU General Public License
48  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49  **
50  *************************************************************************/
51 
52 #ifndef DIALOGMOVING_H
53 #define DIALOGMOVING_H
54 
55 #include <qcompilerdetection.h>
56 #include <QList>
57 #include <QMetaObject>
58 #include <QObject>
59 #include <QString>
60 #include <QVector>
61 #include <QtGlobal>
62 
63 #include "../../tools/drawTools/operation/vabstractoperation.h"
64 #include "../vmisc/def.h"
65 #include "dialogtool.h"
66 
67 namespace Ui
68 {
69  class DialogMove;
70 }
71 
72 class DialogMove : public DialogTool
73 {
74  Q_OBJECT
75 
76 public:
77  explicit DialogMove(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
78  virtual ~DialogMove();
79 
80  QString GetAngle() const;
81  void SetAngle(const QString &value);
82 
83  QString GetLength() const;
84  void SetLength(const QString &value);
85 
86  QString getRotation() const;
87  void setRotation(const QString &value);
88 
89  QString getSuffix() const;
90  void setSuffix(const QString &value);
91 
92  quint32 getOriginPointId() const;
93  void setOriginPointId(const quint32 &value);
94 
95  virtual void ShowDialog(bool click) Q_DECL_OVERRIDE;
96 
98  void setSourceObjects(const QVector<SourceItem> &value);
99 
100 public slots:
101  virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
102  virtual void SelectedObject(bool selected, quint32 id, quint32 tool) Q_DECL_OVERRIDE;
103 
104 private slots:
105  void angleChanged();
106  void lengthChanged();
107  void rotationChanged();
108 
109  void editAngleFormula();
110  void editLengthFormula();
111  void editRotationFormula();
112 
113  void suffixChanged();
114  void originChanged(const QString &text);
115 
116 protected:
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  virtual void SaveData() Q_DECL_OVERRIDE;
122  virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
123 
124 private:
125  Q_DISABLE_COPY(DialogMove)
127  bool angleFlag; //! @brief angleFlag true if value of angle is correct */
128  QString angleFormula; //! @brief angle formula of angle */
129  QTimer *angleTimer; //! @brief angleTimer timer of check formula of angle */
130  bool lengthFlag; //! @brief lengthFlag true if value of length is correct */
131  QString lengthFormula; //! @brief length formula of length */
132  QTimer *lengthTimer; //! @brief lengthTimer timer of check formula of length */
133  bool rotationFlag; //! @brief rotationFlag true if value of length is correct */
134  QString rotationFormula; //! @brief rotationFormula of rotation */
135  QTimer *rotationTimer; //! @brief rotationTimer timer of check formula of rotation */
137  bool stage1;
138  bool stage2;
139  QString m_suffix;
141 
142  void evaluateAngle();
143  void evaluateLength();
144  void evaluateRotation();
145 };
146 
147 #endif // DIALOGMOVING_H
void originChanged(const QString &text)
Definition: dialogmove.cpp:483
void SetAngle(const QString &value)
Definition: dialogmove.cpp:165
QString getRotation() const
Definition: dialogmove.cpp:197
QString angleFormula
angleFlag true if value of angle is correct *‍/
Definition: dialogmove.h:128
virtual ~DialogMove()
Definition: dialogmove.cpp:153
quint32 getOriginPointId() const
Definition: dialogmove.cpp:229
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
Definition: dialogmove.cpp:541
void suffixChanged()
Definition: dialogmove.cpp:443
void editAngleFormula()
Definition: dialogmove.cpp:401
QString GetAngle() const
Definition: dialogmove.cpp:159
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
Definition: dialogmove.cpp:516
QVector< SourceItem > m_objects
rotationTimer timer of check formula of rotation *‍/
Definition: dialogmove.h:136
void setSuffix(const QString &value)
Definition: dialogmove.cpp:222
QString rotationFormula
rotationFlag true if value of length is correct *‍/
Definition: dialogmove.h:134
void rotationChanged()
Definition: dialogmove.cpp:393
void evaluateAngle()
Definition: dialogmove.cpp:566
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
Definition: dialogmove.cpp:329
QString lengthFormula
lengthFlag true if value of length is correct *‍/
Definition: dialogmove.h:131
virtual void SelectedObject(bool selected, quint32 id, quint32 tool) Q_DECL_OVERRIDE
Definition: dialogmove.cpp:349
bool lengthFlag
angleTimer timer of check formula of angle *‍/
Definition: dialogmove.h:130
bool stage1
Definition: dialogmove.h:137
void setOriginPointId(const quint32 &value)
Definition: dialogmove.cpp:235
void lengthChanged()
Definition: dialogmove.cpp:385
void SetLength(const QString &value)
Definition: dialogmove.cpp:184
bool useOriginPoint
Definition: dialogmove.h:140
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
Definition: dialogmove.cpp:501
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
Definition: dialogmove.cpp:244
void evaluateLength()
Definition: dialogmove.cpp:573
bool rotationFlag
lengthTimer timer of check formula of length *‍/
Definition: dialogmove.h:133
QTimer * angleTimer
angle formula of angle *‍/
Definition: dialogmove.h:129
QString GetLength() const
Definition: dialogmove.cpp:178
QTimer * lengthTimer
length formula of length *‍/
Definition: dialogmove.h:132
bool angleFlag
Definition: dialogmove.h:127
QVector< SourceItem > getSourceObjects() const
Definition: dialogmove.cpp:550
void setSourceObjects(const QVector< SourceItem > &value)
Definition: dialogmove.cpp:556
QString getSuffix() const
Definition: dialogmove.cpp:216
bool stage2
Definition: dialogmove.h:138
void setRotation(const QString &value)
Definition: dialogmove.cpp:203
DialogMove(const VContainer *data, quint32 toolId, QWidget *parent=nullptr)
Definition: dialogmove.cpp:90
QString m_suffix
Definition: dialogmove.h:139
void editLengthFormula()
Definition: dialogmove.cpp:415
void editRotationFormula()
Definition: dialogmove.cpp:429
Ui::DialogMove * ui
Definition: dialogmove.h:126
void angleChanged()
Definition: dialogmove.cpp:377
QTimer * rotationTimer
rotationFormula of rotation *‍/
Definition: dialogmove.h:135
void evaluateRotation()
Definition: dialogmove.cpp:581
virtual void ShowVisualization() Q_DECL_OVERRIDE
Definition: dialogmove.cpp:510
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
The VContainer class container of all variables.
Definition: vcontainer.h:141
SceneObject
Definition: def.h:103