2016-07-02 01:49:38 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
2017-02-23 10:26:25 +01:00
|
|
|
** @file vpatternlabeldata.cpp
|
2016-07-02 01:49:38 +02:00
|
|
|
** @author Bojan Kverh
|
|
|
|
** @date June 16, 2016
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2016-07-02 01:49:38 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
2017-02-23 10:26:25 +01:00
|
|
|
#include "vpatternlabeldata.h"
|
2017-02-23 13:36:08 +01:00
|
|
|
#include "vpatternlabeldata_p.h"
|
2017-02-23 12:36:56 +01:00
|
|
|
#include "../ifc/ifcdef.h"
|
2016-07-02 01:49:38 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-02-23 10:26:25 +01:00
|
|
|
VPatternLabelData::VPatternLabelData()
|
2017-02-23 12:26:12 +01:00
|
|
|
: VAbstractFloatItemData(),
|
2017-02-23 13:36:08 +01:00
|
|
|
d(new VPatternLabelDataPrivate())
|
2017-02-23 10:37:19 +01:00
|
|
|
{}
|
|
|
|
|
2017-02-23 13:36:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VPatternLabelData::VPatternLabelData(const VPatternLabelData &data)
|
|
|
|
: VAbstractFloatItemData(data),
|
|
|
|
d (data.d)
|
|
|
|
{}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VPatternLabelData &VPatternLabelData::operator=(const VPatternLabelData &data)
|
|
|
|
{
|
|
|
|
if ( &data == this )
|
|
|
|
{
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
VAbstractFloatItemData::operator=(data);
|
|
|
|
d = data.d;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2019-12-30 12:00:57 +01:00
|
|
|
#ifdef Q_COMPILER_RVALUE_REFS
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VPatternLabelData &VPatternLabelData::operator=(VPatternLabelData &&data) Q_DECL_NOTHROW
|
|
|
|
{
|
|
|
|
Swap(data);
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VPatternLabelData::Swap(VPatternLabelData &data) Q_DECL_NOTHROW
|
|
|
|
{
|
|
|
|
VAbstractFloatItemData::Swap(data);
|
|
|
|
std::swap(d, data.d);
|
|
|
|
}
|
|
|
|
|
2017-02-23 10:37:19 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VPatternLabelData::~VPatternLabelData()
|
2016-12-14 00:56:30 +01:00
|
|
|
{}
|
2016-07-02 01:49:38 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
QString VPatternLabelData::GetLabelWidth() const
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
return d->m_dLabelWidth;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
void VPatternLabelData::SetLabelWidth(const QString &dLabelW)
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
d->m_dLabelWidth = dLabelW;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
QString VPatternLabelData::GetLabelHeight() const
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
return d->m_dLabelHeight;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
void VPatternLabelData::SetLabelHeight(const QString &dLabelH)
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
d->m_dLabelHeight = dLabelH;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-02-23 10:26:25 +01:00
|
|
|
int VPatternLabelData::GetFontSize() const
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
return d->m_iFontSize;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-02-23 10:26:25 +01:00
|
|
|
void VPatternLabelData::SetFontSize(int iSize)
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
d->m_iFontSize = iSize;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
QString VPatternLabelData::GetRotation() const
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-03-13 13:27:29 +01:00
|
|
|
return d->m_dLabelAngle;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2017-03-13 13:27:29 +01:00
|
|
|
void VPatternLabelData::SetRotation(const QString &dRot)
|
2016-07-02 01:49:38 +02:00
|
|
|
{
|
2017-03-13 13:27:29 +01:00
|
|
|
d->m_dLabelAngle = dRot;
|
2016-07-02 01:49:38 +02:00
|
|
|
}
|
2017-02-23 12:36:56 +01:00
|
|
|
|
2017-03-11 14:25:21 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint32 VPatternLabelData::CenterPin() const
|
|
|
|
{
|
|
|
|
return d->m_centerPin;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VPatternLabelData::SetCenterPin(const quint32 ¢erPin)
|
|
|
|
{
|
|
|
|
d->m_centerPin = centerPin;
|
|
|
|
}
|
|
|
|
|
2017-02-23 12:36:56 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint32 VPatternLabelData::TopLeftPin() const
|
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
return d->m_topLeftPin;
|
2017-02-23 12:36:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VPatternLabelData::SetTopLeftPin(const quint32 &topLeftPin)
|
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
d->m_topLeftPin = topLeftPin;
|
2017-02-23 12:36:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint32 VPatternLabelData::BottomRightPin() const
|
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
return d->m_bottomRightPin;
|
2017-02-23 12:36:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VPatternLabelData::SetBottomRightPin(const quint32 &bottomRightPin)
|
|
|
|
{
|
2017-02-23 13:36:08 +01:00
|
|
|
d->m_bottomRightPin = bottomRightPin;
|
2017-02-23 12:36:56 +01:00
|
|
|
}
|