Seamly2D
Code documentation
vnodedetail.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 vnodedetail.h
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date November 15, 2013
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) 2013-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 VNODEDETAIL_H
53 #define VNODEDETAIL_H
54 
55 #include <QMetaType>
56 #include <QSharedDataPointer>
57 #include <QTypeInfo>
58 #include <QtGlobal>
59 
60 #include "../vmisc/def.h"
61 
62 class VNodeDetailData;
63 class VPieceNode;
64 class VContainer;
65 
66 /**
67  * @brief The VNodeDetail class keep information about detail node.
68  */
70 {
71 public:
72  /**
73  * @brief VNodeDetail default constructor.
74  */
75  VNodeDetail();
76  /**
77  * @brief VNodeDetail constructor.
78  * @param id object id
79  * @param typeTool type tool
80  * @param typeNode type node
81  * @param mx object bias x axis
82  * @param my object bias y axis
83  */
84  VNodeDetail(quint32 id, Tool typeTool, NodeDetail typeNode, qreal mx = 0, qreal my = 0, bool reverse = false);
85  /**
86  * @brief VNodeDetail copy constructor
87  * @param node node
88  */
89  VNodeDetail(const VNodeDetail &node);
90 
91  ~VNodeDetail();
92 
93  /**
94  * @brief operator = assignment operator
95  * @param node node
96  * @return node
97  */
98  VNodeDetail &operator=(const VNodeDetail &node);
99 #ifdef Q_COMPILER_RVALUE_REFS
100  VNodeDetail &operator=(VNodeDetail &&node) Q_DECL_NOTHROW;
101 #endif
102 
103  void Swap(VNodeDetail &node) Q_DECL_NOTHROW;
104 
105  /**
106  * @brief getId return object id.
107  * @return id.
108  */
109  quint32 getId() const;
110  /**
111  * @brief setId set object id.
112  * @param value object id.
113  */
114  void setId(const quint32 &value);
115  /**
116  * @brief getTypeTool return tool type.
117  * @return tool type.
118  */
119  Tool getTypeTool() const;
120  /**
121  * @brief setTypeTool set tool type.
122  * @param value tool type.
123  */
124  void setTypeTool(const Tool &value);
125  /**
126  * @brief getTypeNode return node type.
127  * @return node type.
128  */
129  NodeDetail getTypeNode() const;
130  /**
131  * @brief setTypeNode set node type.
132  * @param value node type.
133  */
134  void setTypeNode(const NodeDetail &value);
135  /**
136  * @brief getMx return object bias x axis.
137  * @return bias x axis.
138  */
139  qreal getMx() const;
140  /**
141  * @brief setMx set object bias x axis.
142  * @param value bias x axis.
143  */
144  void setMx(const qreal &value);
145  /**
146  * @brief getMy return object bias y axis.
147  * @return bias y axis.
148  */
149  qreal getMy() const;
150  /**
151  * @brief setMy set object bias y axis.
152  * @param value bias y axis.
153  */
154  void setMy(const qreal &value);
155 
156  bool getReverse() const;
157  void setReverse(bool reverse);
158 
159  static QVector<VPieceNode> Convert(const VContainer *data, const QVector<VNodeDetail> &nodes, qreal width,
160  bool closed);
161 private:
162  QSharedDataPointer<VNodeDetailData> d;
163 };
164 
165 Q_DECLARE_METATYPE(VNodeDetail)
167 
168 #endif // VNODEDETAIL_H
The VContainer class container of all variables.
Definition: vcontainer.h:141
The VNodeDetail class keep information about detail node.
Definition: vnodedetail.h:70
Tool getTypeTool() const
getTypeTool return tool type.
quint32 getId() const
getId return object id.
void setMy(const qreal &value)
setMy set object bias y axis.
static QVector< VPieceNode > Convert(const VContainer *data, const QVector< VNodeDetail > &nodes, qreal width, bool closed)
qreal getMx() const
getMx return object bias x axis.
VNodeDetail & operator=(const VNodeDetail &node)
operator = assignment operator
void setMx(const qreal &value)
setMx set object bias x axis.
bool getReverse() const
void setTypeNode(const NodeDetail &value)
setTypeNode set node type.
void Swap(VNodeDetail &node) Q_DECL_NOTHROW
NodeDetail getTypeNode() const
getTypeNode return node type.
void setTypeTool(const Tool &value)
setTypeTool set tool type.
void setId(const quint32 &value)
setId set object id.
VNodeDetail()
VNodeDetail default constructor.
qreal getMy() const
getMy return object bias y axis.
void setReverse(bool reverse)
QSharedDataPointer< VNodeDetailData > d
Definition: vnodedetail.h:162
NodeDetail
Definition: def.h:102
Tool
Definition: def.h:161
Q_DECLARE_TYPEINFO(VNodeDetail, Q_MOVABLE_TYPE)