2013-09-18 21:16:19 +02:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2013 Valentina project All Rights Reserved.
|
|
|
|
**
|
|
|
|
** This file is part of Valentina.
|
|
|
|
**
|
|
|
|
** Tox 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.
|
|
|
|
**
|
|
|
|
** Tox 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/>.
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2013-07-13 12:51:31 +02:00
|
|
|
#include "vpointf.h"
|
|
|
|
|
2013-08-28 10:55:11 +02:00
|
|
|
VPointF::VPointF():_name(QString()), _mx(0), _my(0), _x(0), _y(0), _referens(0), mode(Draw::Calculation),
|
|
|
|
idObject(0){
|
2013-07-13 12:51:31 +02:00
|
|
|
}
|
|
|
|
|
2013-08-15 22:39:00 +02:00
|
|
|
VPointF::VPointF ( const VPointF & point ):_name(point.name()), _mx(point.mx()), _my(point.my()),
|
2013-09-29 12:29:29 +02:00
|
|
|
_x(point.x()), _y(point.y()), _referens(point.referens()), mode(point.getMode()), idObject(point.getIdObject()){
|
2013-07-13 12:51:31 +02:00
|
|
|
}
|
|
|
|
|
2013-09-27 11:17:00 +02:00
|
|
|
VPointF::VPointF (qreal x, qreal y , QString name, qreal mx, qreal my, Draw::Draws mode, qint64 idObject):_name(name), _mx(mx),
|
2013-08-28 10:55:11 +02:00
|
|
|
_my(my), _x(x), _y(y), _referens(0), mode(mode), idObject(idObject){
|
2013-08-13 18:48:36 +02:00
|
|
|
}
|
|
|
|
|
2013-09-29 12:29:29 +02:00
|
|
|
VPointF &VPointF::operator =(const VPointF &point){
|
|
|
|
_name = point.name();
|
|
|
|
_mx = point.mx();
|
|
|
|
_my = point.my();
|
|
|
|
_x = point.x();
|
|
|
|
_y = point.y();
|
|
|
|
_referens = point.referens();
|
|
|
|
mode = point.getMode();
|
|
|
|
idObject = point.getIdObject();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2013-08-13 18:48:36 +02:00
|
|
|
VPointF::~VPointF(){
|
2013-07-13 12:51:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
QString VPointF::name() const{
|
|
|
|
return _name;
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal VPointF::mx() const{
|
|
|
|
return _mx;
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal VPointF::my() const{
|
|
|
|
return _my;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setName(const QString& name){
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setMx(qreal mx){
|
|
|
|
_mx = mx;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setMy(qreal my){
|
|
|
|
_my = my;
|
|
|
|
}
|
|
|
|
|
|
|
|
QPointF VPointF::toQPointF()const{
|
2013-08-13 18:48:36 +02:00
|
|
|
return QPointF(_x, _y);
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal VPointF::y() const{
|
|
|
|
return _y;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setY(const qreal &value){
|
|
|
|
_y = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
qreal VPointF::x() const{
|
|
|
|
return _x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setX(const qreal &value){
|
|
|
|
_x = value;
|
2013-07-13 12:51:31 +02:00
|
|
|
}
|
2013-08-28 10:55:11 +02:00
|
|
|
|
|
|
|
qint32 VPointF::referens() const{
|
|
|
|
return _referens;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::incrementReferens(){
|
|
|
|
++_referens;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::decrementReferens(){
|
|
|
|
if(_referens > 0){
|
|
|
|
--_referens;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-27 11:17:00 +02:00
|
|
|
Draw::Draws VPointF::getMode() const
|
2013-08-28 10:55:11 +02:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2013-09-27 11:17:00 +02:00
|
|
|
void VPointF::setMode(const Draw::Draws &value)
|
2013-08-28 10:55:11 +02:00
|
|
|
{
|
|
|
|
mode = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
qint64 VPointF::getIdObject() const{
|
|
|
|
return idObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VPointF::setIdObject(const qint64 &value){
|
|
|
|
idObject = value;
|
|
|
|
}
|