Seamly2D
Code documentation
dialogtruedarts.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 dialogtruedarts.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 12 6, 2015
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) 2015 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 DIALOGTRUEDARTS_H
53 #define DIALOGTRUEDARTS_H
54 
55 #include <qcompilerdetection.h>
56 #include <QMetaObject>
57 #include <QObject>
58 #include <QString>
59 #include <QtGlobal>
60 
61 #include "../vmisc/def.h"
62 #include "dialogtool.h"
63 
64 namespace Ui
65 {
66  class DialogTrueDarts;
67 }
68 
70 {
71  Q_OBJECT
72 
73 public:
74  DialogTrueDarts(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
76 
77  QString GetFirstNewDartPointName();
78  QString GetSecondNewDartPointName();
79  void SetNewDartPointNames(const QString &firstPoint, const QString &secondPoint);
80 
81  quint32 GetFirstBasePointId() const;
82  void SetFirstBasePointId(const quint32 &value);
83 
84  quint32 GetSecondBasePointId() const;
85  void SetSecondBasePointId(const quint32 &value);
86 
87  quint32 GetFirstDartPointId() const;
88  void SetFirstDartPointId(const quint32 &value);
89 
90  quint32 GetSecondDartPointId() const;
91  void SetSecondDartPointId(const quint32 &value);
92 
93  quint32 GetThirdDartPointId() const;
94  void SetThirdDartPointId(const quint32 &value);
95 
96  void SetChildrenId(const quint32 &ch1, const quint32 &ch2);
97 public slots:
98  virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
99  virtual void PointNameChanged() Q_DECL_OVERRIDE;
100  void NameDartPoint1Changed();
101  void NameDartPoint2Changed();
102 protected:
103  virtual void ShowVisualization() Q_DECL_OVERRIDE;
104  /**
105  * @brief SaveData Put dialog data in local variables
106  */
107  virtual void SaveData() Q_DECL_OVERRIDE;
108  virtual void CheckState() Q_DECL_FINAL;
109 
110 private:
111  Q_DISABLE_COPY(DialogTrueDarts)
113 
114  QString d1PointName;
115  QString d2PointName;
116 
117  quint32 ch1;
118  quint32 ch2;
119 
120  bool flagName1;
121  bool flagName2;
122 
123  void NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name,
124  QLineEdit *secondPointName, bool &flagName);
125 
126  void FillComboBoxs(const quint32 &ch1, const quint32 &ch2);
127 
128  void CheckName(QLineEdit* edit, QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name,
129  QLineEdit *secondPointName, bool &flagName);
130 };
131 
132 #endif // DIALOGTRUEDARTS_H
The DialogTool class parent for all dialog of tools.
Definition: dialogtool.h:107
bool flagName
flagName true if name is correct
Definition: dialogtool.h:183
QLabel * labelEditNamePoint
labelEditNamePoint label used when need show wrong name of point
Definition: dialogtool.h:214
quint32 toolId
Definition: dialogtool.h:225
const VContainer * data
data container with data
Definition: dialogtool.h:177
QString GetSecondNewDartPointName()
void SetSecondDartPointId(const quint32 &value)
void FillComboBoxs(const quint32 &ch1, const quint32 &ch2)
DialogTrueDarts(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
quint32 GetSecondDartPointId() const
virtual void ShowVisualization() Q_DECL_OVERRIDE
QString GetFirstNewDartPointName()
void CheckName(QLineEdit *edit, QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName)
void SetNewDartPointNames(const QString &firstPoint, const QString &secondPoint)
void SetFirstDartPointId(const quint32 &value)
void SetSecondBasePointId(const quint32 &value)
void SetFirstBasePointId(const quint32 &value)
void SetThirdDartPointId(const quint32 &value)
quint32 GetFirstBasePointId() const
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
void NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, QLineEdit *secondPointName, bool &flagName)
quint32 GetThirdDartPointId() const
Ui::DialogTrueDarts * ui
virtual void PointNameChanged() Q_DECL_OVERRIDE
void SetChildrenId(const quint32 &ch1, const quint32 &ch2)
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
quint32 GetFirstDartPointId() const
quint32 GetSecondBasePointId() const
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
The VContainer class container of all variables.
Definition: vcontainer.h:141
SceneObject
Definition: def.h:103