2014-07-09 14:23:04 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vvariable.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 9 7, 2014
|
|
|
|
**
|
|
|
|
** @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) 2014 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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VVARIABLE_H
|
|
|
|
#define VVARIABLE_H
|
|
|
|
|
2014-07-29 13:28:18 +02:00
|
|
|
#include "vinternalvariable.h"
|
2014-07-09 14:23:04 +02:00
|
|
|
|
2014-07-29 13:28:18 +02:00
|
|
|
class VVariable :public VInternalVariable
|
2014-07-09 14:23:04 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
VVariable();
|
2014-07-29 13:28:18 +02:00
|
|
|
VVariable(const QString &name, const qreal &base, const qreal &ksize, const qreal &kheight,
|
|
|
|
const QString &description = QString());
|
|
|
|
VVariable(const QString &name, const qreal &base, const QString &description = QString());
|
2014-07-09 14:23:04 +02:00
|
|
|
VVariable(const VVariable &var);
|
|
|
|
VVariable &operator=(const VVariable &var);
|
|
|
|
virtual ~VVariable();
|
|
|
|
|
|
|
|
qreal GetBase() const;
|
|
|
|
void SetBase(const qreal &value);
|
|
|
|
qreal GetKsize() const;
|
|
|
|
qreal GetKheight() const;
|
|
|
|
QString GetDescription() const;
|
2014-07-29 13:28:18 +02:00
|
|
|
void SetValue(const qreal &size, const qreal &height);
|
2014-07-09 14:23:04 +02:00
|
|
|
protected:
|
|
|
|
/** @brief base value in base size and height */
|
2014-07-29 13:28:18 +02:00
|
|
|
qreal base;
|
2014-07-09 14:23:04 +02:00
|
|
|
|
|
|
|
/** @brief ksize increment in sizes */
|
2014-07-29 13:28:18 +02:00
|
|
|
qreal ksize;
|
2014-07-09 14:23:04 +02:00
|
|
|
|
|
|
|
/** @brief kgrowth increment in heights */
|
2014-07-29 13:28:18 +02:00
|
|
|
qreal kheight;
|
2014-07-09 14:23:04 +02:00
|
|
|
|
|
|
|
/** @brief description description of increment */
|
2014-07-29 13:28:18 +02:00
|
|
|
QString description;
|
2014-07-09 14:23:04 +02:00
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief GetBase return value in base size and height
|
|
|
|
* @return value
|
|
|
|
*/
|
|
|
|
inline qreal VVariable::GetBase() const
|
|
|
|
{
|
|
|
|
return base;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline void VVariable::SetBase(const qreal &value)
|
|
|
|
{
|
|
|
|
base = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief GetKsize return increment in sizes
|
|
|
|
* @return increment
|
|
|
|
*/
|
|
|
|
inline qreal VVariable::GetKsize() const
|
|
|
|
{
|
|
|
|
return ksize;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
/**
|
|
|
|
* @brief GetKheight return increment in heights
|
|
|
|
* @return increment
|
|
|
|
*/
|
|
|
|
inline qreal VVariable::GetKheight() const
|
|
|
|
{
|
|
|
|
return kheight;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
inline QString VVariable::GetDescription() const
|
|
|
|
{
|
|
|
|
return description;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // VVARIABLE_H
|