Seamly2D
Code documentation
vpiecelabeldata.cpp
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file vpiecelabeldata.cpp
4  ** @author Bojan Kverh
5  ** @date June 16, 2016
6  **
7  ** @brief
8  ** @copyright
9  ** This source code is part of the Valentine project, a pattern making
10  ** program, whose allow create and modeling patterns of clothing.
11  ** Copyright (C) 2013-2015 Seamly2D project
12  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
13  **
14  ** Seamly2D is free software: you can redistribute it and/or modify
15  ** it under the terms of the GNU General Public License as published by
16  ** the Free Software Foundation, either version 3 of the License, or
17  ** (at your option) any later version.
18  **
19  ** Seamly2D is distributed in the hope that it will be useful,
20  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  ** GNU General Public License for more details.
23  **
24  ** You should have received a copy of the GNU General Public License
25  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #include "vpiecelabeldata.h"
30 #include "vpiecelabeldata_p.h"
31 
32 #include <QList>
33 
34 #ifdef Q_COMPILER_RVALUE_REFS
36 { Swap(data); return *this; }
37 #endif
38 
39 void VPieceLabelData::Swap(VPieceLabelData &data) Q_DECL_NOTHROW
40 { VPatternLabelData::Swap(data); std::swap(d, data.d); }
41 
42 //---------------------------------------------------------------------------------------------------------------------
45  d(new VPieceLabelDataPrivate())
46 {}
47 
48 //---------------------------------------------------------------------------------------------------------------------
50  : VPatternLabelData(data),
51  d (data.d)
52 {}
53 
54 //---------------------------------------------------------------------------------------------------------------------
56 {
57  if ( &data == this )
58  {
59  return *this;
60  }
62  d = data.d;
63  return *this;
64 }
65 
66 //---------------------------------------------------------------------------------------------------------------------
68 {}
69 
70 //---------------------------------------------------------------------------------------------------------------------
72 {
73  d->m_qsLetter.clear();
74 }
75 
76 //---------------------------------------------------------------------------------------------------------------------
78 {
79  return d->m_qsLetter;
80 }
81 
82 //---------------------------------------------------------------------------------------------------------------------
83 void VPieceLabelData::SetLetter(const QString &qsLetter)
84 {
85  d->m_qsLetter = qsLetter.left(3);
86 }
87 
88 //---------------------------------------------------------------------------------------------------------------------
90 {
91  return d->m_annotation;
92 }
93 
94 //---------------------------------------------------------------------------------------------------------------------
95 void VPieceLabelData::SetAnnotation(const QString &val)
96 {
97  d->m_annotation = val;
98 }
99 
100 //---------------------------------------------------------------------------------------------------------------------
102 {
103  return d->m_orientation;
104 }
105 
106 //---------------------------------------------------------------------------------------------------------------------
107 void VPieceLabelData::SetOrientation(const QString &val)
108 {
109  d->m_orientation = val;
110 }
111 
112 //---------------------------------------------------------------------------------------------------------------------
114 {
115  return d->m_rotation;
116 }
117 
118 //---------------------------------------------------------------------------------------------------------------------
119 void VPieceLabelData::SetRotationWay(const QString &val)
120 {
121  d->m_rotation = val;
122 }
123 
124 //---------------------------------------------------------------------------------------------------------------------
126 {
127  return d->m_tilt;
128 }
129 
130 //---------------------------------------------------------------------------------------------------------------------
131 void VPieceLabelData::SetTilt(const QString &val)
132 {
133  d->m_tilt = val;
134 }
135 
136 //---------------------------------------------------------------------------------------------------------------------
138 {
139  return d->m_foldPosition;
140 }
141 
142 //---------------------------------------------------------------------------------------------------------------------
143 void VPieceLabelData::SetFoldPosition(const QString &val)
144 {
145  d->m_foldPosition = val;
146 }
147 
148 //---------------------------------------------------------------------------------------------------------------------
150 {
151  return d->m_quantity;
152 }
153 
154 //---------------------------------------------------------------------------------------------------------------------
156 {
157  if (val >= 1)
158  {
159  d->m_quantity = val;
160  }
161 }
162 
163 //---------------------------------------------------------------------------------------------------------------------
165 {
166  return d->m_onFold;
167 }
168 
169 //---------------------------------------------------------------------------------------------------------------------
170 void VPieceLabelData::SetOnFold(bool onFold)
171 {
172  d->m_onFold = onFold;
173 }
174 
175 //---------------------------------------------------------------------------------------------------------------------
177 {
178  return d->m_lines;
179 }
180 
181 //---------------------------------------------------------------------------------------------------------------------
183 {
184  d->m_lines = lines;
185 }
The VPatternLabelData class holds the information about pattern info label geometry.
void Swap(VPatternLabelData &data) Q_DECL_NOTHROW
VPatternLabelData & operator=(const VPatternLabelData &data)
The VPieceLabelData class holds some information about a single piece like letter,...
QSharedDataPointer< VPieceLabelDataPrivate > d
void SetAnnotation(const QString &val)
void SetOnFold(bool onFold)
void SetLabelTemplate(const QVector< VLabelTemplateLine > &lines)
VPieceLabelData & operator=(const VPieceLabelData &data)
virtual ~VPieceLabelData()
QString GetOrientation() const
void SetTilt(const QString &val)
void SetRotationWay(const QString &val)
void SetFoldPosition(const QString &val)
QVector< VLabelTemplateLine > GetLabelTemplate() const
void SetQuantity(int val)
bool IsOnFold() const
int GetQuantity() const
void Swap(VPieceLabelData &data) Q_DECL_NOTHROW
QString GetRotationWay() const
void SetOrientation(const QString &val)
void SetLetter(const QString &qsLetter)
QString GetAnnotation() const
QString GetTilt() const
QString GetLetter() const
QString GetFoldPosition() const