Seamly2D
Code documentation
vpiecenode.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
27  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
28  ** @date 3 11, 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 VPIECENODE_H
53 #define VPIECENODE_H
54 
55 #include <QtGlobal>
56 #include <QSharedDataPointer>
57 #include <QMetaType>
58 
59 #include "../vmisc/def.h"
60 
61 class VPieceNodeData;
62 class VContainer;
63 
65 {
66 public:
67  VPieceNode();
68  VPieceNode(quint32 id, Tool typeTool, bool reverse = false);
69  VPieceNode(const VPieceNode &node);
70 
71  ~VPieceNode();
72 
73  VPieceNode &operator=(const VPieceNode &node);
74 
75 #ifdef Q_COMPILER_RVALUE_REFS
76  VPieceNode &operator=(VPieceNode &&node) Q_DECL_NOTHROW;
77 #endif
78 
79  void Swap(VPieceNode &node) Q_DECL_NOTHROW;
80 
81  friend QDataStream &operator<<(QDataStream &out, const VPieceNode &);
82  friend QDataStream &operator>>(QDataStream &in, VPieceNode &p);
83 
84  quint32 GetId() const;
85  void SetId(quint32 id);
86 
87  Tool GetTypeTool() const;
88  void SetTypeTool(Tool value);
89 
90  bool GetReverse() const;
91  void SetReverse(bool reverse);
92 
93  bool isExcluded() const;
94  void SetExcluded(bool exclude);
95 
96  qreal GetSABefore(const VContainer *data) const;
97  qreal GetSABefore(const VContainer *data, Unit unit) const;
98 
99  QString GetFormulaSABefore() const;
100  void setBeforeSAFormula(const QString &formula);
101 
102  qreal GetSAAfter(const VContainer *data) const;
103  qreal GetSAAfter(const VContainer *data, Unit unit) const;
104 
105  QString GetFormulaSAAfter() const;
106  void setAfterSAFormula(const QString &formula);
107 
109  void SetAngleType(PieceNodeAngle type);
110 
111  bool isNotch() const;
112  void setNotch(bool notch);
113 
114  bool IsMainPathNode() const;
115  void SetMainPathNode(bool value);
116 
117  NotchType getNotchType() const;
118  void setNotchType(NotchType notchType);
119 
121  void setNotchSubType(NotchSubType notchSubType);
122 
123  bool showSeamlineNotch() const;
124  void setShowSeamlineNotch(bool value);
125 
126  bool showNotch() const;
127  void setShowNotch(bool value);
128 
129  qreal getNotchLength() const;
130  void setNotchLength(qreal notchLength);
131 
132  qreal getNotchWidth() const;
133  void setNotchWidth(qreal notchWidth);
134 
135  qreal getNotchAngle() const;
136  void setNotchAngle(qreal notchAngle);
137 
138  int getNotchCount() const;
139  void setNotchCount(int notchCount);
140 
141 private:
142  QSharedDataPointer<VPieceNodeData> d;
143 };
144 
145 Q_DECLARE_METATYPE(VPieceNode)
147 
148 #endif // VPIECENODE_H
The VContainer class container of all variables.
Definition: vcontainer.h:141
void setBeforeSAFormula(const QString &formula)
Definition: vpiecenode.cpp:221
void setShowNotch(bool value)
Definition: vpiecenode.cpp:344
qreal GetSABefore(const VContainer *data) const
Definition: vpiecenode.cpp:188
void setNotchCount(int notchCount)
Definition: vpiecenode.cpp:399
void SetExcluded(bool exclude)
Definition: vpiecenode.cpp:417
void setNotch(bool notch)
Definition: vpiecenode.cpp:293
Tool GetTypeTool() const
Definition: vpiecenode.cpp:161
bool showNotch() const
Definition: vpiecenode.cpp:338
quint32 GetId() const
Definition: vpiecenode.cpp:149
bool isExcluded() const
Definition: vpiecenode.cpp:411
friend QDataStream & operator<<(QDataStream &out, const VPieceNode &)
Definition: vpiecenode.cpp:135
void setNotchType(NotchType notchType)
Definition: vpiecenode.cpp:320
void setAfterSAFormula(const QString &formula)
Definition: vpiecenode.cpp:263
void SetTypeTool(Tool value)
Definition: vpiecenode.cpp:167
PieceNodeAngle GetAngleType() const
Definition: vpiecenode.cpp:272
void setNotchLength(qreal notchLength)
Definition: vpiecenode.cpp:363
friend QDataStream & operator>>(QDataStream &in, VPieceNode &p)
Definition: vpiecenode.cpp:142
NotchType getNotchType() const
Definition: vpiecenode.cpp:314
void Swap(VPieceNode &node) Q_DECL_NOTHROW
Definition: vpiecenode.cpp:100
QString GetFormulaSAAfter() const
Definition: vpiecenode.cpp:257
void setNotchWidth(qreal notchWidth)
Definition: vpiecenode.cpp:375
qreal getNotchAngle() const
Definition: vpiecenode.cpp:393
void SetMainPathNode(bool value)
Definition: vpiecenode.cpp:308
QString GetFormulaSABefore() const
Definition: vpiecenode.cpp:215
QSharedDataPointer< VPieceNodeData > d
Definition: vpiecenode.h:142
bool GetReverse() const
Definition: vpiecenode.cpp:173
void setShowSeamlineNotch(bool value)
Definition: vpiecenode.cpp:356
void SetAngleType(PieceNodeAngle type)
Definition: vpiecenode.cpp:278
qreal GetSAAfter(const VContainer *data) const
Definition: vpiecenode.cpp:230
bool IsMainPathNode() const
Definition: vpiecenode.cpp:302
qreal getNotchLength() const
Definition: vpiecenode.cpp:369
VPieceNode & operator=(const VPieceNode &node)
Definition: vpiecenode.cpp:119
bool isNotch() const
Definition: vpiecenode.cpp:287
void SetReverse(bool reverse)
Definition: vpiecenode.cpp:179
int getNotchCount() const
Definition: vpiecenode.cpp:405
void setNotchAngle(qreal notchAngle)
Definition: vpiecenode.cpp:387
NotchSubType getNotchSubType() const
Definition: vpiecenode.cpp:326
void SetId(quint32 id)
Definition: vpiecenode.cpp:155
qreal getNotchWidth() const
Definition: vpiecenode.cpp:381
bool showSeamlineNotch() const
Definition: vpiecenode.cpp:350
void setNotchSubType(NotchSubType notchSubType)
Definition: vpiecenode.cpp:332
NotchType
Definition: def.h:123
PieceNodeAngle
Definition: def.h:113
NotchSubType
Definition: def.h:137
Unit
Definition: def.h:105
Tool
Definition: def.h:161
Q_DECLARE_TYPEINFO(VPieceNode, Q_MOVABLE_TYPE)