Seamly2D
Code documentation
vgrainlinedata.cpp
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file vgrainlinedata.cpp
4  ** @author Bojan Kverh
5  ** @date September 06, 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 <QPointF>
30 
31 #include "vgrainlinedata.h"
32 #include "vgrainlinedata_p.h"
33 
34 #ifdef Q_COMPILER_RVALUE_REFS
35 VGrainlineData &VGrainlineData::operator=(VGrainlineData &&data) Q_DECL_NOTHROW { Swap(data); return *this; }
36 #endif
37 
38 void VGrainlineData::Swap(VGrainlineData &data) Q_DECL_NOTHROW
39 { VAbstractFloatItemData::Swap(data); std::swap(d, data.d); }
40 
41 //---------------------------------------------------------------------------------------------------------------------
44  d(new VGrainlineDataPrivate())
45 {}
46 
47 //---------------------------------------------------------------------------------------------------------------------
49  : VAbstractFloatItemData(data),
50  d (data.d)
51 {}
52 
53 //---------------------------------------------------------------------------------------------------------------------
55 {
56  if ( &data == this )
57  {
58  return *this;
59  }
61  d = data.d;
62  return *this;
63 }
64 
65 //---------------------------------------------------------------------------------------------------------------------
67 {}
68 
69 //---------------------------------------------------------------------------------------------------------------------
71 {
72  return d->m_qsLength;
73 }
74 
75 //---------------------------------------------------------------------------------------------------------------------
76 void VGrainlineData::SetLength(const QString& qsLen)
77 {
78  d->m_qsLength = qsLen;
79 }
80 
81 //---------------------------------------------------------------------------------------------------------------------
83 {
84  return d->m_dRotation;
85 }
86 
87 //---------------------------------------------------------------------------------------------------------------------
88 void VGrainlineData::SetRotation(const QString& qsRot)
89 {
90  d->m_dRotation = qsRot;
91 }
92 
93 //---------------------------------------------------------------------------------------------------------------------
95 {
96  return d->m_eArrowType;
97 }
98 
99 //---------------------------------------------------------------------------------------------------------------------
101 {
102  d->m_eArrowType = eAT;
103 }
104 
105 //---------------------------------------------------------------------------------------------------------------------
107 {
108  return d->m_centerAnchorPoint;
109 }
110 
111 //---------------------------------------------------------------------------------------------------------------------
112 void VGrainlineData::setCenterAnchorPoint(quint32 centerAnchor)
113 {
114  d->m_centerAnchorPoint = centerAnchor;
115 }
116 
117 //---------------------------------------------------------------------------------------------------------------------
119 {
120  return d->m_topAnchorPoint;
121 }
122 
123 //---------------------------------------------------------------------------------------------------------------------
124 void VGrainlineData::setTopAnchorPoint(quint32 topAnchorPoint)
125 {
126  d->m_topAnchorPoint = topAnchorPoint;
127 }
128 
129 //---------------------------------------------------------------------------------------------------------------------
131 {
132  return d->m_bottomAnchorPoint;
133 }
134 
135 //---------------------------------------------------------------------------------------------------------------------
136 void VGrainlineData::setBottomAnchorPoint(quint32 bottomAnchorPoint)
137 {
138  d->m_bottomAnchorPoint = bottomAnchorPoint;
139 }
void Swap(VAbstractFloatItemData &data) Q_DECL_NOTHROW
VAbstractFloatItemData & operator=(const VAbstractFloatItemData &data)
The VGrainlineData class holds information about a grainline like position, size, rotation and visibi...
ArrowType GetArrowType() const
QSharedDataPointer< VGrainlineDataPrivate > d
VGrainlineData & operator=(const VGrainlineData &data)
void setBottomAnchorPoint(quint32 bottomAnchorPoint)
virtual ~VGrainlineData()
void SetRotation(const QString &qsRot)
quint32 centerAnchorPoint() const
QString GetRotation() const
void SetLength(const QString &qsLen)
void SetArrowType(ArrowType eAT)
quint32 bottomAnchorPoint() const
void Swap(VGrainlineData &data) Q_DECL_NOTHROW
quint32 topAnchorPoint() const
void setCenterAnchorPoint(quint32 centerAnchor)
QString GetLength() const
void setTopAnchorPoint(quint32 topAnchorPoint)
ArrowType
Definition: floatitemdef.h:60