Seamly2D
Code documentation
insert_nodes_dialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file insert_nodes_dialog.h
3  ** @author Douglas S Caskey
4  ** @date Dec 11, 2022
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2022 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 /************************************************************************
26  **
27  ** @file dialoginsertnode.h
28  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
29  ** @date 21 3, 2017
30  **
31  ** @brief
32  ** @copyright
33  ** This source code is part of the Valentina project, a pattern making
34  ** program, whose allow create and modeling patterns of clothing.
35  ** Copyright (C) 2017 Valentina project
36  ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
37  **
38  ** Valentina is free software: you can redistribute it and/or modify
39  ** it under the terms of the GNU General Public License as published by
40  ** the Free Software Foundation, either version 3 of the License, or
41  ** (at your option) any later version.
42  **
43  ** Valentina is distributed in the hope that it will be useful,
44  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
45  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46  ** GNU General Public License for more details.
47  **
48  ** You should have received a copy of the GNU General Public License
49  ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
50  **
51  *************************************************************************/
52 
53 #ifndef INSERT_NODES_DIALOG_H
54 #define INSERT_NODES_DIALOG_H
55 
56 #include "dialogtool.h"
57 #include "../vpatterndb/vpiecenode.h"
58 
59 #include <QSound>
60 
61 class VPieceNode;
62 
63 namespace Ui
64 {
65  class InsertNodesDialog;
66 }
67 
69 {
70  Q_OBJECT
71 
72 public:
73  explicit InsertNodesDialog(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
74  virtual ~InsertNodesDialog();
75 
76  virtual void SetPiecesList(const QVector<quint32> &list) Q_DECL_OVERRIDE;
77 
78  quint32 getPieceId() const;
79 
81 
82  virtual void ShowDialog(bool click) Q_DECL_OVERRIDE;
83 
84 public slots:
85  virtual void SelectedObject(bool selected, quint32 object, quint32 tool) Q_DECL_OVERRIDE;
86 
87 private slots:
88  void showContextMenu(const QPoint &pos);
89 
90 protected:
91  virtual void checkState() Q_DECL_FINAL;
92  virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
93 
94 private:
95  Q_DISABLE_COPY(InsertNodesDialog)
97 
99  bool m_nodeFlag;
101  QSound *m_beep;
102  void validatePieces();
103  void validateNodes();
104  quint32 getLastNodeId() const;
105  bool correctCurveDirection(quint32 objectId);
106  void insertCurveNodes(VPieceNode curveNode);
107 };
108 
109 #endif // INSERT_NODES_DIALOG_H
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
QVector< VPieceNode > m_nodes
virtual void SelectedObject(bool selected, quint32 object, quint32 tool) Q_DECL_OVERRIDE
Ui::InsertNodesDialog * ui
bool correctCurveDirection(quint32 objectId)
quint32 getLastNodeId() const
QVector< VPieceNode > getNodes() const
quint32 getPieceId() const
InsertNodesDialog(const VContainer *data, quint32 toolId, QWidget *parent=nullptr)
void showContextMenu(const QPoint &pos)
virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
virtual void SetPiecesList(const QVector< quint32 > &list) Q_DECL_OVERRIDE
void insertCurveNodes(VPieceNode curveNode)
virtual void checkState() Q_DECL_FINAL
The VContainer class container of all variables.
Definition: vcontainer.h:141