diff --git a/src/libs/vpatterndb/variables/varcradius.cpp b/src/libs/vpatterndb/variables/varcradius.cpp index 2366552a1..c4fa85687 100644 --- a/src/libs/vpatterndb/variables/varcradius.cpp +++ b/src/libs/vpatterndb/variables/varcradius.cpp @@ -33,7 +33,7 @@ #include "../ifc/ifcdef.h" #include "../vgeometry/varc.h" -#include "vcurvevariable.h" +#include "../vgeometry/vellipticalarc.h" //--------------------------------------------------------------------------------------------------------------------- VArcRadius::VArcRadius() @@ -49,10 +49,29 @@ VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *a SCASSERT(arc != nullptr) SetType(VarType::ArcRadius); - SetName(QString(radius_V+"%1").arg(arc->name())); + SetName(radius_V + QString("%1").arg(arc->name())); SetValue(FromPixel(arc->GetRadius(), patternUnit)); } +//--------------------------------------------------------------------------------------------------------------------- +VArcRadius::VArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc, const int numberRadius, + Unit patternUnit) + : VCurveVariable(id, parentId) +{ + SCASSERT(elArc != nullptr) + + SetType(VarType::ArcRadius); + SetName(radius_V + QString("%1%2").arg(numberRadius).arg(elArc->name())); + if (numberRadius == 1) + { + SetValue(FromPixel(elArc->GetRadius1(), patternUnit)); + } + else + { + SetValue(FromPixel(elArc->GetRadius2(), patternUnit)); + } +} + //--------------------------------------------------------------------------------------------------------------------- VArcRadius::VArcRadius(const VArcRadius &var) :VCurveVariable(var) diff --git a/src/libs/vpatterndb/variables/varcradius.h b/src/libs/vpatterndb/variables/varcradius.h index 4d32d5ce5..beb85a168 100644 --- a/src/libs/vpatterndb/variables/varcradius.h +++ b/src/libs/vpatterndb/variables/varcradius.h @@ -37,12 +37,15 @@ #include "vcurvevariable.h" class VArc; +class VEllipticalArc; class VArcRadius :public VCurveVariable { public: VArcRadius(); VArcRadius(const quint32 &id, const quint32 &parentId, const VArc *arc, Unit patternUnit); + VArcRadius(const quint32 &id, const quint32 &parentId, const VEllipticalArc *elArc, const int numberRadius, + Unit patternUnit); VArcRadius(const VArcRadius &var); VArcRadius &operator=(const VArcRadius &var); virtual ~VArcRadius() Q_DECL_OVERRIDE; diff --git a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp b/src/libs/vpatterndb/variables/vellipticalarcradius.cpp deleted file mode 100644 index 0503ee75c..000000000 --- a/src/libs/vpatterndb/variables/vellipticalarcradius.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/************************************************************************ - ** - ** @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 deleted file mode 100644 index 2ce41edf4..000000000 --- a/src/libs/vpatterndb/variables/vellipticalarcradius.h +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************ - ** - ** @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/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index 2034fbc3d..6bb83bfaa 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -45,7 +45,6 @@ #include "../vmisc/logging.h" #include "../vmisc/vabstractapplication.h" #include "variables/varcradius.h" -#include "variables/vellipticalarcradius.h" #include "variables/vcurveangle.h" #include "variables/vcurvelength.h" #include "variables/vcurveclength.h" @@ -410,10 +409,10 @@ void VContainer::AddArc(const QSharedPointer &arc, const quint32 { const QSharedPointer casted = arc.staticCast(); - VEllipticalArcRadius *radius1 = new VEllipticalArcRadius(id, parentId, casted.data(), 1, *GetPatternUnit()); + VArcRadius *radius1 = new VArcRadius(id, parentId, casted.data(), 1, *GetPatternUnit()); AddVariable(radius1->GetName(), radius1); - VEllipticalArcRadius *radius2 = new VEllipticalArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit()); + VArcRadius *radius2 = new VArcRadius(id, parentId, casted.data(), 2, *GetPatternUnit()); AddVariable(radius2->GetName(), radius2); } } diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index 5a94d2ff8..abf31776a 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -21,7 +21,6 @@ SOURCES += \ $$PWD/vpatterninfogeometry.cpp \ $$PWD/vgrainlinegeometry.cpp \ $$PWD/variables/vcurveclength.cpp \ - $$PWD/variables/vellipticalarcradius.cpp \ $$PWD/vpiece.cpp \ $$PWD/vpiecenode.cpp \ $$PWD/vpiecepath.cpp @@ -59,7 +58,6 @@ HEADERS += \ $$PWD/vpatterninfogeometry.h \ $$PWD/vgrainlinegeometry.h \ $$PWD/variables/vcurveclength.h \ - $$PWD/variables/vellipticalarcradius.h \ $$PWD/vpiece.h \ $$PWD/vpiece_p.h \ $$PWD/vpiecenode.h \