From 9e3fd67eb678e6b01053b88878eae5f16d842597 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Sat, 17 Dec 2016 03:34:12 +0200 Subject: [PATCH] Added VEllipticalArcRadius. --HG-- branch : feature --- .../variables/vellipticalarcradius.cpp | 80 ++++++++++++ .../variables/vellipticalarcradius.h | 51 ++++++++ src/libs/vpatterndb/vpatterndb.pri | 122 +++++++++--------- 3 files changed, 193 insertions(+), 60 deletions(-) create mode 100644 src/libs/vpatterndb/variables/vellipticalarcradius.cpp create mode 100644 src/libs/vpatterndb/variables/vellipticalarcradius.h diff --git a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp new file mode 100644 index 000000000..aa900362f --- /dev/null +++ b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp @@ -0,0 +1,80 @@ +/************************************************************************ + ** + ** @file vellipticalarcradius.cpp + ** @author Valentina Zhuravska + ** @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 + ** 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 . + ** + *************************************************************************/ +#include "vellipticalarcradius.h" + +#include +#include + +#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() +{} diff --git a/src/libs/vpatterndb/variables/vellipticalarcradius.h b/src/libs/vpatterndb/variables/vellipticalarcradius.h new file mode 100644 index 000000000..2ce41edf4 --- /dev/null +++ b/src/libs/vpatterndb/variables/vellipticalarcradius.h @@ -0,0 +1,51 @@ +/************************************************************************ + ** + ** @file vellipticalarcradius.h + ** @author Valentina Zhuravska + ** @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 + ** 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 . + ** + *************************************************************************/ +#ifndef VELLIPTICALARCRADIUS_H +#define VELLIPTICALARCRADIUS_H + +#include +#include + +#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 diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index c1ae5168a..ead57870f 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -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