Added VEllipticalArcRadius.

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2016-12-17 03:34:12 +02:00
parent aa24976f9a
commit 9e3fd67eb6
3 changed files with 193 additions and 60 deletions

View File

@ -0,0 +1,80 @@
/************************************************************************
**
** @file vellipticalarcradius.cpp
** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
** @date 16 12, 2016
**
** @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) 2016 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 "vellipticalarcradius.h"
#include <QMessageLogger>
#include <QString>
#include "../ifc/ifcdef.h"
#include "../vgeometry/vellipticalarc.h"
#include "vcurvevariable.h"
//---------------------------------------------------------------------------------------------------------------------
VEllipticalArcRadius::VEllipticalArcRadius()
:VCurveVariable()
{
SetType(VarType::ArcRadius);
}
//---------------------------------------------------------------------------------------------------------------------
VEllipticalArcRadius::VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
const int numberRadius, Unit patternUnit) : VCurveVariable(id, parentId)
{
SCASSERT(elArc != nullptr);
SetType(VarType::ArcRadius);
SetName(QString(radius_V+"%1"+"%2").arg(numberRadius).arg(elArc->name()));
if (numberRadius == 1)
{
SetValue(FromPixel(elArc->GetRadius1(), patternUnit));
}
else
{
SetValue(FromPixel(elArc->GetRadius2(), patternUnit));
}
}
//---------------------------------------------------------------------------------------------------------------------
VEllipticalArcRadius::VEllipticalArcRadius(const VEllipticalArcRadius &var)
:VCurveVariable(var)
{}
//---------------------------------------------------------------------------------------------------------------------
VEllipticalArcRadius &VEllipticalArcRadius::operator=(const VEllipticalArcRadius &var)
{
if ( &var == this )
{
return *this;
}
VCurveVariable::operator=(var);
return *this;
}
//---------------------------------------------------------------------------------------------------------------------
VEllipticalArcRadius::~VEllipticalArcRadius()
{}

View File

@ -0,0 +1,51 @@
/************************************************************************
**
** @file vellipticalarcradius.h
** @author Valentina Zhuravska <zhuravska19(at)gmail.com>
** @date 16 12, 2016
**
** @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) 2016 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 VELLIPTICALARCRADIUS_H
#define VELLIPTICALARCRADIUS_H
#include <qcompilerdetection.h>
#include <QtGlobal>
#include "../vmisc/def.h"
#include "../ifc/ifcdef.h"
#include "vcurvevariable.h"
class VEllipticalArc;
class VEllipticalArcRadius :public VCurveVariable
{
public:
VEllipticalArcRadius();
VEllipticalArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc,
const int numberRadius, Unit patternUnit);
VEllipticalArcRadius(const VEllipticalArcRadius &var);
VEllipticalArcRadius &operator=(const VEllipticalArcRadius &var);
virtual ~VEllipticalArcRadius() Q_DECL_OVERRIDE;
};
#endif // VELLIPTICALARCRADIUS_H

View File

@ -1,60 +1,62 @@
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
SOURCES += \
$$PWD/vcontainer.cpp \
$$PWD/calculator.cpp \
$$PWD/vdetail.cpp \
$$PWD/vnodedetail.cpp \
$$PWD/vtranslatevars.cpp \
$$PWD/variables/varcradius.cpp \
$$PWD/variables/vcurveangle.cpp \
$$PWD/variables/vcurvelength.cpp \
$$PWD/variables/vcurvevariable.cpp \
$$PWD/variables/vincrement.cpp \
$$PWD/variables/vinternalvariable.cpp \
$$PWD/variables/vlineangle.cpp \
$$PWD/variables/vlinelength.cpp \
$$PWD/variables/vmeasurement.cpp \
$$PWD/variables/vvariable.cpp \
$$PWD/vformula.cpp \
$$PWD/vpatternpiecedata.cpp \
$$PWD/vpatterninfogeometry.cpp \
$$PWD/vgrainlinegeometry.cpp \
$$PWD/variables/vcurveclength.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
HEADERS += \
$$PWD/vcontainer.h \
$$PWD/stable.h \
$$PWD/calculator.h \
$$PWD/variables.h \
$$PWD/vdetail.h \
$$PWD/vdetail_p.h \
$$PWD/vnodedetail.h \
$$PWD/vnodedetail_p.h \
$$PWD/vtranslatevars.h \
$$PWD/variables/varcradius.h \
$$PWD/variables/varcradius_p.h \
$$PWD/variables/vcurveangle.h \
$$PWD/variables/vcurvelength.h \
$$PWD/variables/vcurvevariable.h \
$$PWD/variables/vcurvevariable_p.h \
$$PWD/variables/vincrement.h \
$$PWD/variables/vincrement_p.h \
$$PWD/variables/vinternalvariable.h \
$$PWD/variables/vinternalvariable_p.h \
$$PWD/variables/vlineangle.h \
$$PWD/variables/vlineangle_p.h \
$$PWD/variables/vlinelength.h \
$$PWD/variables/vlinelength_p.h \
$$PWD/variables/vmeasurement.h \
$$PWD/variables/vmeasurement_p.h \
$$PWD/variables/vvariable.h \
$$PWD/variables/vvariable_p.h \
$$PWD/vformula.h \
$$PWD/vpatternpiecedata.h \
$$PWD/vpatterninfogeometry.h \
$$PWD/vgrainlinegeometry.h \
$$PWD/variables/vcurveclength.h
# ADD TO EACH PATH $$PWD VARIABLE!!!!!!
# This need for corect working file translations.pro
SOURCES += \
$$PWD/vcontainer.cpp \
$$PWD/calculator.cpp \
$$PWD/vdetail.cpp \
$$PWD/vnodedetail.cpp \
$$PWD/vtranslatevars.cpp \
$$PWD/variables/varcradius.cpp \
$$PWD/variables/vcurveangle.cpp \
$$PWD/variables/vcurvelength.cpp \
$$PWD/variables/vcurvevariable.cpp \
$$PWD/variables/vincrement.cpp \
$$PWD/variables/vinternalvariable.cpp \
$$PWD/variables/vlineangle.cpp \
$$PWD/variables/vlinelength.cpp \
$$PWD/variables/vmeasurement.cpp \
$$PWD/variables/vvariable.cpp \
$$PWD/vformula.cpp \
$$PWD/vpatternpiecedata.cpp \
$$PWD/vpatterninfogeometry.cpp \
$$PWD/vgrainlinegeometry.cpp \
$$PWD/variables/vcurveclength.cpp \
$$PWD/variables/vellipticalarcradius.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
HEADERS += \
$$PWD/vcontainer.h \
$$PWD/stable.h \
$$PWD/calculator.h \
$$PWD/variables.h \
$$PWD/vdetail.h \
$$PWD/vdetail_p.h \
$$PWD/vnodedetail.h \
$$PWD/vnodedetail_p.h \
$$PWD/vtranslatevars.h \
$$PWD/variables/varcradius.h \
$$PWD/variables/varcradius_p.h \
$$PWD/variables/vcurveangle.h \
$$PWD/variables/vcurvelength.h \
$$PWD/variables/vcurvevariable.h \
$$PWD/variables/vcurvevariable_p.h \
$$PWD/variables/vincrement.h \
$$PWD/variables/vincrement_p.h \
$$PWD/variables/vinternalvariable.h \
$$PWD/variables/vinternalvariable_p.h \
$$PWD/variables/vlineangle.h \
$$PWD/variables/vlineangle_p.h \
$$PWD/variables/vlinelength.h \
$$PWD/variables/vlinelength_p.h \
$$PWD/variables/vmeasurement.h \
$$PWD/variables/vmeasurement_p.h \
$$PWD/variables/vvariable.h \
$$PWD/variables/vvariable_p.h \
$$PWD/vformula.h \
$$PWD/vpatternpiecedata.h \
$$PWD/vpatterninfogeometry.h \
$$PWD/vgrainlinegeometry.h \
$$PWD/variables/vcurveclength.h \
$$PWD/variables/vellipticalarcradius.h