2013-12-29 17:48:57 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vgobject.cpp
|
2014-04-30 07:38:52 +02:00
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
2013-12-29 17:48:57 +01:00
|
|
|
** @date 27 12, 2013
|
|
|
|
**
|
|
|
|
** @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.
|
|
|
|
**
|
|
|
|
** 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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vgobject.h"
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
VGObject::VGObject()
|
2014-03-11 12:43:24 +01:00
|
|
|
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation)
|
2014-05-02 13:11:30 +02:00
|
|
|
{}
|
2013-12-29 17:48:57 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-11 12:43:24 +01:00
|
|
|
VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode)
|
2013-12-30 20:33:30 +01:00
|
|
|
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
2014-05-02 13:11:30 +02:00
|
|
|
{}
|
2013-12-29 17:48:57 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
VGObject::VGObject(const VGObject &obj)
|
2013-12-30 20:33:30 +01:00
|
|
|
:_id(obj.id()), type(obj.getType()), idObject(obj.getIdObject()), _name(obj.name()), mode(obj.getMode())
|
2014-05-02 13:11:30 +02:00
|
|
|
{}
|
2013-12-29 17:48:57 +01:00
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
VGObject &VGObject::operator=(const VGObject &obj)
|
|
|
|
{
|
|
|
|
this->_id = obj.id();
|
|
|
|
this->type = obj.getType();
|
|
|
|
this->idObject = obj.getIdObject();
|
|
|
|
this->_name = obj.name();
|
|
|
|
this->mode = obj.getMode();
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-02-25 15:40:24 +01:00
|
|
|
quint32 VGObject::getIdObject() const
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
return idObject;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-02-25 15:40:24 +01:00
|
|
|
void VGObject::setIdObject(const quint32 &value)
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
idObject = value;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
QString VGObject::name() const
|
|
|
|
{
|
|
|
|
return _name;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
void VGObject::setName(const QString &name)
|
|
|
|
{
|
|
|
|
_name = name;
|
|
|
|
}
|
|
|
|
|
2014-03-11 12:43:24 +01:00
|
|
|
Valentina::Draws VGObject::getMode() const
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-03-11 12:43:24 +01:00
|
|
|
void VGObject::setMode(const Valentina::Draws &value)
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
mode = value;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2013-12-29 17:48:57 +01:00
|
|
|
GObject::Type VGObject::getType() const
|
|
|
|
{
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-02-25 15:40:24 +01:00
|
|
|
quint32 VGObject::id() const
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
return _id;
|
|
|
|
}
|
|
|
|
|
2014-05-02 13:11:30 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-02-25 15:40:24 +01:00
|
|
|
void VGObject::setId(const quint32 &id)
|
2013-12-29 17:48:57 +01:00
|
|
|
{
|
|
|
|
_id = id;
|
|
|
|
}
|