2013-11-15 13:41:26 +01:00
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
** @file vincrementtablerow.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2013 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
** 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.
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
** 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/>.
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
2014-03-19 19:27:11 +01:00
|
|
|
#include "vincrement.h"
|
2014-08-20 18:31:15 +02:00
|
|
|
#include "vincrement_p.h"
|
2014-08-17 17:20:55 +02:00
|
|
|
#include "../options.h"
|
2013-07-17 13:38:11 +02:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-06-01 09:35:13 +02:00
|
|
|
/**
|
|
|
|
* @brief VIncrement create enpty increment
|
|
|
|
*/
|
2014-03-19 19:27:11 +01:00
|
|
|
VIncrement::VIncrement()
|
2014-08-20 18:31:15 +02:00
|
|
|
:VVariable(), d(new VIncrementData)
|
2014-07-29 13:28:18 +02:00
|
|
|
{
|
2014-08-20 17:58:10 +02:00
|
|
|
SetType(VarType::Increment);
|
2014-07-29 13:28:18 +02:00
|
|
|
}
|
2013-07-17 13:38:11 +02:00
|
|
|
|
2014-06-01 09:35:13 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief VIncrementTableRow create increment
|
2014-07-29 13:28:18 +02:00
|
|
|
* @param name increment's name
|
2014-06-01 09:35:13 +02:00
|
|
|
* @param id id
|
2014-07-09 14:23:04 +02:00
|
|
|
* @param base value in base size and height
|
2014-06-01 09:35:13 +02:00
|
|
|
* @param ksize increment in sizes
|
|
|
|
* @param kheight increment in heights
|
|
|
|
* @param description description of increment
|
|
|
|
*/
|
2014-07-29 13:28:18 +02:00
|
|
|
VIncrement::VIncrement(const QString &name, quint32 id, qreal base, qreal ksize, qreal kheight, QString description)
|
2014-08-20 18:31:15 +02:00
|
|
|
:VVariable(name, base, ksize, kheight, description), d(new VIncrementData(id))
|
2014-07-29 13:28:18 +02:00
|
|
|
{
|
2014-08-20 17:58:10 +02:00
|
|
|
SetType(VarType::Increment);
|
2014-07-29 13:28:18 +02:00
|
|
|
}
|
2014-03-19 19:27:11 +01:00
|
|
|
|
2014-06-04 13:50:13 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VIncrement::VIncrement(const VIncrement &incr)
|
2014-08-20 18:31:15 +02:00
|
|
|
:VVariable(incr), d(incr.d)
|
2014-06-04 13:50:13 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VIncrement &VIncrement::operator=(const VIncrement &incr)
|
|
|
|
{
|
2014-07-27 14:30:28 +02:00
|
|
|
if ( &incr == this )
|
|
|
|
{
|
|
|
|
return *this;
|
|
|
|
}
|
2014-07-09 14:23:04 +02:00
|
|
|
VVariable::operator=(incr);
|
2014-08-20 18:31:15 +02:00
|
|
|
d = incr.d;
|
2014-06-04 13:50:13 +02:00
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-07-09 14:23:04 +02:00
|
|
|
VIncrement::~VIncrement()
|
|
|
|
{}
|
2014-08-20 18:31:15 +02:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief getId return id of row
|
|
|
|
* @return id
|
|
|
|
*/
|
|
|
|
quint32 VIncrement::getId() const
|
|
|
|
{
|
|
|
|
return d->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief setId set id of row
|
|
|
|
* @param value id
|
|
|
|
*/
|
|
|
|
void VIncrement::setId(const quint32 &value)
|
|
|
|
{
|
|
|
|
d->id = value;
|
|
|
|
}
|