1 /************************************************************************
2  **
3  **  @file   vpatternlabeldata.cpp
4  **  @author Bojan Kverh
5  **  @date   June 16, 2016
6  **
7  **  @brief
8  **  @copyright
9  **  This source code is part of the Valentina project, a pattern making
10  **  program, whose allow create and modeling patterns of clothing.
11  **  Copyright (C) 2013-2015 Valentina project
12  **  <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
13  **
14  **  Valentina 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  **  Valentina 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 Valentina.  If not, see <http://www.gnu.org/licenses/>.
26  **
27  *************************************************************************/
28 
29 #include "vpatternlabeldata.h"
30 #include "vpatternlabeldata_p.h"
31 #include "../ifc/ifcdef.h"
32 
33 //---------------------------------------------------------------------------------------------------------------------
VPatternLabelData()34 VPatternLabelData::VPatternLabelData()
35     : VAbstractFloatItemData(),
36       d(new VPatternLabelDataPrivate())
37 {}
38 
39 //---------------------------------------------------------------------------------------------------------------------
VPatternLabelData(const VPatternLabelData & data)40 VPatternLabelData::VPatternLabelData(const VPatternLabelData &data)
41     : VAbstractFloatItemData(data),
42       d (data.d)
43 {}
44 
45 //---------------------------------------------------------------------------------------------------------------------
operator =(const VPatternLabelData & data)46 VPatternLabelData &VPatternLabelData::operator=(const VPatternLabelData &data)
47 {
48     if ( &data == this )
49     {
50         return *this;
51     }
52     VAbstractFloatItemData::operator=(data);
53     d = data.d;
54     return *this;
55 }
56 
57 #ifdef Q_COMPILER_RVALUE_REFS
58 //---------------------------------------------------------------------------------------------------------------------
VPatternLabelData(const VPatternLabelData && data)59 VPatternLabelData::VPatternLabelData(const VPatternLabelData &&data) Q_DECL_NOTHROW
60     : VAbstractFloatItemData(data),
61       d (data.d)
62 {}
63 
64 //---------------------------------------------------------------------------------------------------------------------
operator =(VPatternLabelData && data)65 VPatternLabelData &VPatternLabelData::operator=(VPatternLabelData &&data) Q_DECL_NOTHROW
66 {
67     VAbstractFloatItemData::operator=(data);
68     std::swap(d, data.d);
69     return *this;
70 }
71 #endif
72 
73 //---------------------------------------------------------------------------------------------------------------------
~VPatternLabelData()74 VPatternLabelData::~VPatternLabelData()
75 {}
76 
77 //---------------------------------------------------------------------------------------------------------------------
GetLabelWidth() const78 QString VPatternLabelData::GetLabelWidth() const
79 {
80     return d->m_dLabelWidth;
81 }
82 
83 //---------------------------------------------------------------------------------------------------------------------
SetLabelWidth(const QString & dLabelW)84 void VPatternLabelData::SetLabelWidth(const QString &dLabelW)
85 {
86     d->m_dLabelWidth = dLabelW;
87 }
88 
89 //---------------------------------------------------------------------------------------------------------------------
GetLabelHeight() const90 QString VPatternLabelData::GetLabelHeight() const
91 {
92     return d->m_dLabelHeight;
93 }
94 
95 //---------------------------------------------------------------------------------------------------------------------
SetLabelHeight(const QString & dLabelH)96 void VPatternLabelData::SetLabelHeight(const QString &dLabelH)
97 {
98     d->m_dLabelHeight = dLabelH;
99 }
100 
101 //---------------------------------------------------------------------------------------------------------------------
GetFontSize() const102 int VPatternLabelData::GetFontSize() const
103 {
104     return d->m_iFontSize;
105 }
106 
107 //---------------------------------------------------------------------------------------------------------------------
SetFontSize(int iSize)108 void VPatternLabelData::SetFontSize(int iSize)
109 {
110     d->m_iFontSize = iSize;
111 }
112 
113 //---------------------------------------------------------------------------------------------------------------------
GetRotation() const114 QString VPatternLabelData::GetRotation() const
115 {
116     return d->m_dLabelAngle;
117 }
118 
119 //---------------------------------------------------------------------------------------------------------------------
SetRotation(const QString & dRot)120 void VPatternLabelData::SetRotation(const QString &dRot)
121 {
122     d->m_dLabelAngle = dRot;
123 }
124 
125 //---------------------------------------------------------------------------------------------------------------------
CenterPin() const126 quint32 VPatternLabelData::CenterPin() const
127 {
128     return d->m_centerPin;
129 }
130 
131 //---------------------------------------------------------------------------------------------------------------------
SetCenterPin(const quint32 & centerPin)132 void VPatternLabelData::SetCenterPin(const quint32 &centerPin)
133 {
134     d->m_centerPin = centerPin;
135 }
136 
137 //---------------------------------------------------------------------------------------------------------------------
TopLeftPin() const138 quint32 VPatternLabelData::TopLeftPin() const
139 {
140     return d->m_topLeftPin;
141 }
142 
143 //---------------------------------------------------------------------------------------------------------------------
SetTopLeftPin(const quint32 & topLeftPin)144 void VPatternLabelData::SetTopLeftPin(const quint32 &topLeftPin)
145 {
146     d->m_topLeftPin = topLeftPin;
147 }
148 
149 //---------------------------------------------------------------------------------------------------------------------
BottomRightPin() const150 quint32 VPatternLabelData::BottomRightPin() const
151 {
152     return d->m_bottomRightPin;
153 }
154 
155 //---------------------------------------------------------------------------------------------------------------------
SetBottomRightPin(const quint32 & bottomRightPin)156 void VPatternLabelData::SetBottomRightPin(const quint32 &bottomRightPin)
157 {
158     d->m_bottomRightPin = bottomRightPin;
159 }
160