From d1480132a0e1143a574a6742379840c73b70b715 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 1 Apr 2016 22:34:57 +0300 Subject: [PATCH] Don't separate data about spline and arc length and angles. --HG-- branch : develop --- .../valentina/dialogs/dialogincrements.cpp | 29 +------ src/app/valentina/dialogs/dialogincrements.h | 2 - src/app/valentina/dialogs/dialogincrements.ui | 81 +------------------ src/app/valentina/xml/vpattern.cpp | 6 +- src/libs/vmisc/def.h | 4 +- src/libs/vpatterndb/variables.h | 6 +- src/libs/vpatterndb/variables/varcangle.cpp | 73 ----------------- src/libs/vpatterndb/variables/varcangle.h | 46 ----------- src/libs/vpatterndb/variables/varclength.cpp | 64 --------------- src/libs/vpatterndb/variables/varclength.h | 46 ----------- src/libs/vpatterndb/variables/vcurveangle.cpp | 6 +- .../vpatterndb/variables/vcurvelength.cpp | 4 +- .../vpatterndb/variables/vsplineangle.cpp | 73 ----------------- src/libs/vpatterndb/variables/vsplineangle.h | 46 ----------- .../vpatterndb/variables/vsplinelength.cpp | 74 ----------------- src/libs/vpatterndb/variables/vsplinelength.h | 47 ----------- src/libs/vpatterndb/vcontainer.cpp | 68 ++++++---------- src/libs/vpatterndb/vcontainer.h | 16 ++-- src/libs/vpatterndb/vpatterndb.pri | 8 -- .../support/dialogeditwrongformula.cpp | 39 +-------- .../dialogs/support/dialogeditwrongformula.h | 2 - .../dialogs/support/dialogeditwrongformula.ui | 30 ------- 22 files changed, 50 insertions(+), 720 deletions(-) delete mode 100644 src/libs/vpatterndb/variables/varcangle.cpp delete mode 100644 src/libs/vpatterndb/variables/varcangle.h delete mode 100644 src/libs/vpatterndb/variables/varclength.cpp delete mode 100644 src/libs/vpatterndb/variables/varclength.h delete mode 100644 src/libs/vpatterndb/variables/vsplineangle.cpp delete mode 100644 src/libs/vpatterndb/variables/vsplineangle.h delete mode 100644 src/libs/vpatterndb/variables/vsplinelength.cpp delete mode 100644 src/libs/vpatterndb/variables/vsplinelength.h diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index a459061d5..724495f91 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -76,9 +76,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par FillLengthsLines(); FillLengthLinesAngles(); FillLengthsCurves(); - FillLengthArcs(); FillRadiusesArcs(); - FillAnglesArcs(); FillAnglesCurves(); connect(this, &DialogIncrements::FullUpdateTree, this->doc, &VPattern::LiteParseTree); @@ -211,16 +209,7 @@ void DialogIncrements::FillLengthLinesAngles() */ void DialogIncrements::FillLengthsCurves() { - FillTable(data->DataLengthSplines(), ui->tableWidgetSplines); -} - -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief FillLengthArcs fill data for table of arcs lengths - */ -void DialogIncrements::FillLengthArcs() -{ - FillTable(data->DataLengthArcs(), ui->tableWidgetArcs); + FillTable(data->DataLengthCurves(), ui->tableWidgetSplines); } //--------------------------------------------------------------------------------------------------------------------- @@ -229,12 +218,6 @@ void DialogIncrements::FillRadiusesArcs() FillTable(data->DataRadiusesArcs(), ui->tableWidgetRadiusesArcs); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogIncrements::FillAnglesArcs() -{ - FillTable(data->DataAnglesArcs(), ui->tableWidgetAnglesArcs); -} - //--------------------------------------------------------------------------------------------------------------------- void DialogIncrements::FillAnglesCurves() { @@ -251,11 +234,9 @@ void DialogIncrements::ShowUnits() ShowHeaderUnits(ui->tableWidgetLines, 1, unit);// lengths ShowHeaderUnits(ui->tableWidgetSplines, 1, unit);// lengths - ShowHeaderUnits(ui->tableWidgetArcs, 1, unit);// lengths - ShowHeaderUnits(ui->tableWidgetLinesAngles, 1, "°");// angle + ShowHeaderUnits(ui->tableWidgetLinesAngles, 1, degreeSymbol);// angle ShowHeaderUnits(ui->tableWidgetRadiusesArcs, 1, unit);// radius - ShowHeaderUnits(ui->tableWidgetAnglesArcs, 1, "°");// angle - ShowHeaderUnits(ui->tableWidgetAnglesCurves, 1, "°");// angle + ShowHeaderUnits(ui->tableWidgetAnglesCurves, 1, degreeSymbol);// angle } //--------------------------------------------------------------------------------------------------------------------- @@ -430,8 +411,6 @@ void DialogIncrements::FullUpdateFromFile() { ui->tableWidgetLines->clearContents(); ui->tableWidgetSplines->clearContents(); - ui->tableWidgetArcs->clearContents(); - ui->tableWidgetAnglesArcs->clearContents(); ui->tableWidgetAnglesCurves->clearContents(); ui->tableWidgetLinesAngles->clearContents(); ui->tableWidgetRadiusesArcs->clearContents(); @@ -440,9 +419,7 @@ void DialogIncrements::FullUpdateFromFile() FillLengthsLines(); FillLengthLinesAngles(); FillLengthsCurves(); - FillLengthArcs(); FillRadiusesArcs(); - FillAnglesArcs(); FillAnglesCurves(); } diff --git a/src/app/valentina/dialogs/dialogincrements.h b/src/app/valentina/dialogs/dialogincrements.h index 18032ffe7..03a07e8e0 100644 --- a/src/app/valentina/dialogs/dialogincrements.h +++ b/src/app/valentina/dialogs/dialogincrements.h @@ -94,9 +94,7 @@ private: void FillLengthsLines(); void FillLengthLinesAngles(); void FillLengthsCurves(); - void FillLengthArcs(); void FillRadiusesArcs(); - void FillAnglesArcs(); void FillAnglesCurves(); void ShowUnits(); diff --git a/src/app/valentina/dialogs/dialogincrements.ui b/src/app/valentina/dialogs/dialogincrements.ui index b5569c169..9f82196e8 100644 --- a/src/app/valentina/dialogs/dialogincrements.ui +++ b/src/app/valentina/dialogs/dialogincrements.ui @@ -39,7 +39,7 @@ QTabWidget::North - 0 + 3 @@ -568,45 +568,6 @@ - - - Lengths arcs - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - false - - - 137 - - - false - - - false - - - - Arc - - - - - Length - - - - - - Radiuses arcs @@ -646,45 +607,6 @@ - - - Angles arcs - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - false - - - 137 - - - false - - - false - - - - Arc - - - - - Angle - - - - - - @@ -695,7 +617,6 @@ toolButtonRemove tableWidgetLines tableWidgetSplines - tableWidgetArcs diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 3b691a784..d7ec2fc93 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -3066,13 +3066,11 @@ void VPattern::PrepareForParse(const Document &parse) { data->ClearUniqueNames(); data->ClearVariables(VarType::Increment); - data->ClearVariables(VarType::ArcLength); data->ClearVariables(VarType::LineAngle); data->ClearVariables(VarType::LineLength); - data->ClearVariables(VarType::SplineLength); + data->ClearVariables(VarType::CurveLength); data->ClearVariables(VarType::ArcRadius); - data->ClearVariables(VarType::ArcAngle); - data->ClearVariables(VarType::SplineAngle); + data->ClearVariables(VarType::CurveAngle); } } diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 73421ebce..6987cc452 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -141,8 +141,8 @@ enum class Vis : ToolVisHolderType ToolTrueDarts }; -enum class VarType : char { Measurement, Increment, LineLength, SplineLength, ArcLength, ArcRadius, LineAngle, ArcAngle, - SplineAngle, Unknown }; +enum class VarType : char { Measurement, Increment, LineLength, CurveLength, LineAngle, CurveAngle, ArcRadius, + Unknown }; enum class GHeights : unsigned char { ALL, H92=92, H98=98, H104=104, H110=110, H116=116, H122=122, H128=128, H134=134, diff --git a/src/libs/vpatterndb/variables.h b/src/libs/vpatterndb/variables.h index f187403e0..f07b5a709 100644 --- a/src/libs/vpatterndb/variables.h +++ b/src/libs/vpatterndb/variables.h @@ -32,12 +32,10 @@ #include "variables/vinternalvariable.h" #include "variables/vmeasurement.h" #include "variables/vincrement.h" -#include "variables/varclength.h" -#include "variables/vsplinelength.h" +#include "variables/vcurvelength.h" #include "variables/vlinelength.h" #include "variables/vlineangle.h" #include "variables/varcradius.h" -#include "variables/varcangle.h" -#include "variables/vsplineangle.h" +#include "variables/vcurveangle.h" #endif // VARIABLES_H diff --git a/src/libs/vpatterndb/variables/varcangle.cpp b/src/libs/vpatterndb/variables/varcangle.cpp deleted file mode 100644 index 84d7d7fce..000000000 --- a/src/libs/vpatterndb/variables/varcangle.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************ - ** - ** @file varcangle.cpp - ** @author Roman Telezhynskyi - ** @date 1 6, 2015 - ** - ** @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) 2015 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 "varcangle.h" -#include "../vgeometry/vabstractcurve.h" - -//--------------------------------------------------------------------------------------------------------------------- -VArcAngle::VArcAngle() - :VCurveAngle() -{ - SetType(VarType::ArcAngle); -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcAngle::VArcAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle) - :VCurveAngle(id, parentId, curve, angle) -{ - SetType(VarType::ArcAngle); - SCASSERT(curve != nullptr); - if (angle == CurveAngle::StartAngle) - { - SetName(QString(angle1_V+"%1").arg(curve->name())); - } - else - { - SetName(QString(angle2_V+"%1").arg(curve->name())); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcAngle::VArcAngle(const VArcAngle &var) - :VCurveAngle(var) -{} - -//--------------------------------------------------------------------------------------------------------------------- -VArcAngle &VArcAngle::operator=(const VArcAngle &var) -{ - if ( &var == this ) - { - return *this; - } - VCurveAngle::operator=(var); - return *this; -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcAngle::~VArcAngle() -{} diff --git a/src/libs/vpatterndb/variables/varcangle.h b/src/libs/vpatterndb/variables/varcangle.h deleted file mode 100644 index b3ff56a6b..000000000 --- a/src/libs/vpatterndb/variables/varcangle.h +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************ - ** - ** @file varcangle.h - ** @author Roman Telezhynskyi - ** @date 1 6, 2015 - ** - ** @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) 2015 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 VARCANGLE_H -#define VARCANGLE_H - -#include "vcurveangle.h" - -class VAbstractCurve; - -class VArcAngle :public VCurveAngle -{ -public: - VArcAngle(); - VArcAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle); - VArcAngle(const VArcAngle &var); - VArcAngle &operator=(const VArcAngle &var); - virtual ~VArcAngle() Q_DECL_OVERRIDE; -}; - -#endif // VARCANGLE_H diff --git a/src/libs/vpatterndb/variables/varclength.cpp b/src/libs/vpatterndb/variables/varclength.cpp deleted file mode 100644 index c94e39a34..000000000 --- a/src/libs/vpatterndb/variables/varclength.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************ - ** - ** @file varclength.cpp - ** @author Roman Telezhynskyi - ** @date 28 7, 2014 - ** - ** @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-2015 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 "varclength.h" -#include "../vgeometry/vabstractcurve.h" - -//--------------------------------------------------------------------------------------------------------------------- -VArcLength::VArcLength() - :VCurveLength() -{ - SetType(VarType::ArcLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcLength::VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit) - :VCurveLength(id, parentId, arc, patternUnit) -{ - SetType(VarType::ArcLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcLength::VArcLength(const VArcLength &var) - :VCurveLength(var) -{} - -//--------------------------------------------------------------------------------------------------------------------- -VArcLength &VArcLength::operator=(const VArcLength &var) -{ - if ( &var == this ) - { - return *this; - } - VCurveLength::operator=(var); - return *this; -} - -//--------------------------------------------------------------------------------------------------------------------- -VArcLength::~VArcLength() -{} diff --git a/src/libs/vpatterndb/variables/varclength.h b/src/libs/vpatterndb/variables/varclength.h deleted file mode 100644 index 4b499dcf4..000000000 --- a/src/libs/vpatterndb/variables/varclength.h +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************ - ** - ** @file varclength.h - ** @author Roman Telezhynskyi - ** @date 28 7, 2014 - ** - ** @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-2015 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 VARCLENGTH_H -#define VARCLENGTH_H - -#include "../vpatterndb/variables/vcurvelength.h" - -class VAbstractCurve; - -class VArcLength :public VCurveLength -{ -public: - VArcLength(); - VArcLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *arc, Unit patternUnit); - VArcLength(const VArcLength &var); - VArcLength &operator=(const VArcLength &var); - virtual ~VArcLength() Q_DECL_OVERRIDE; -}; - -#endif // VARCLENGTH_H diff --git a/src/libs/vpatterndb/variables/vcurveangle.cpp b/src/libs/vpatterndb/variables/vcurveangle.cpp index 99c572acb..ec90ba6f7 100644 --- a/src/libs/vpatterndb/variables/vcurveangle.cpp +++ b/src/libs/vpatterndb/variables/vcurveangle.cpp @@ -33,22 +33,24 @@ VCurveAngle::VCurveAngle() :VCurveVariable() { - SetType(VarType::Unknown); + SetType(VarType::CurveAngle); } //--------------------------------------------------------------------------------------------------------------------- VCurveAngle::VCurveAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle) :VCurveVariable(id, parentId) { - SetType(VarType::Unknown); + SetType(VarType::CurveAngle); SCASSERT(curve != nullptr); if (angle == CurveAngle::StartAngle) { SetValue(curve->GetStartAngle()); + SetName(QString(angle1_V+"%1").arg(curve->name())); } else { SetValue(curve->GetEndAngle()); + SetName(QString(angle2_V+"%1").arg(curve->name())); } } diff --git a/src/libs/vpatterndb/variables/vcurvelength.cpp b/src/libs/vpatterndb/variables/vcurvelength.cpp index 15201a482..14529e786 100644 --- a/src/libs/vpatterndb/variables/vcurvelength.cpp +++ b/src/libs/vpatterndb/variables/vcurvelength.cpp @@ -33,14 +33,14 @@ VCurveLength::VCurveLength() :VCurveVariable() { - SetType(VarType::Unknown); + SetType(VarType::CurveLength); } //--------------------------------------------------------------------------------------------------------------------- VCurveLength::VCurveLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, Unit patternUnit) :VCurveVariable(id, parentId) { - SetType(VarType::Unknown); + SetType(VarType::CurveLength); SCASSERT(curve != nullptr); SetName(curve->name()); SetValue(FromPixel(curve->GetLength(), patternUnit)); diff --git a/src/libs/vpatterndb/variables/vsplineangle.cpp b/src/libs/vpatterndb/variables/vsplineangle.cpp deleted file mode 100644 index ff2aab200..000000000 --- a/src/libs/vpatterndb/variables/vsplineangle.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************ - ** - ** @file vsplineangle.cpp - ** @author Roman Telezhynskyi - ** @date 1 6, 2015 - ** - ** @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) 2015 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 "vsplineangle.h" -#include "../vgeometry/vabstractcurve.h" - -//--------------------------------------------------------------------------------------------------------------------- -VSplineAngle::VSplineAngle() - :VCurveAngle() -{ - SetType(VarType::SplineAngle); -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineAngle::VSplineAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle) - :VCurveAngle(id, parentId, curve, angle) -{ - SetType(VarType::SplineAngle); - SCASSERT(curve != nullptr); - if (angle == CurveAngle::StartAngle) - { - SetName(QString(angle1_V+"%1").arg(curve->name())); - } - else - { - SetName(QString(angle2_V+"%1").arg(curve->name())); - } -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineAngle::VSplineAngle(const VSplineAngle &var) - :VCurveAngle(var) -{} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineAngle &VSplineAngle::operator=(const VSplineAngle &var) -{ - if ( &var == this ) - { - return *this; - } - VCurveAngle::operator=(var); - return *this; -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineAngle::~VSplineAngle() -{} diff --git a/src/libs/vpatterndb/variables/vsplineangle.h b/src/libs/vpatterndb/variables/vsplineangle.h deleted file mode 100644 index beefb93e9..000000000 --- a/src/libs/vpatterndb/variables/vsplineangle.h +++ /dev/null @@ -1,46 +0,0 @@ -/************************************************************************ - ** - ** @file vsplineangle.h - ** @author Roman Telezhynskyi - ** @date 1 6, 2015 - ** - ** @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) 2015 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 VSPLINEANGLE_H -#define VSPLINEANGLE_H - -#include "vcurveangle.h" - -class VAbstractCurve; - -class VSplineAngle :public VCurveAngle -{ -public: - VSplineAngle(); - VSplineAngle(const quint32 &id, const quint32 &parentId, const VAbstractCurve *curve, CurveAngle angle); - VSplineAngle(const VSplineAngle &var); - VSplineAngle &operator=(const VSplineAngle &var); - virtual ~VSplineAngle() Q_DECL_OVERRIDE; -}; - -#endif // VSPLINEANGLE_H diff --git a/src/libs/vpatterndb/variables/vsplinelength.cpp b/src/libs/vpatterndb/variables/vsplinelength.cpp deleted file mode 100644 index 75cb80458..000000000 --- a/src/libs/vpatterndb/variables/vsplinelength.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/************************************************************************ - ** - ** @file vsplinelength.cpp - ** @author Roman Telezhynskyi - ** @date 28 7, 2014 - ** - ** @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-2015 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 "vsplinelength.h" -#include "../vgeometry/vabstractcurve.h" - -//--------------------------------------------------------------------------------------------------------------------- -VSplineLength::VSplineLength() - :VCurveLength() -{ - SetType(VarType::SplineLength); -} - -VSplineLength::VSplineLength(const quint32 &id, const quint32 &parentId, const QString &name, const qreal &value) - :VCurveLength() -{ - SetType(VarType::SplineLength); - SetName(name); - SetValue(value); - SetId(id); - SetParentId(parentId); -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineLength::VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path, Unit patternUnit) - :VCurveLength(id, parentId, path, patternUnit) -{ - SetType(VarType::SplineLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineLength::VSplineLength(const VSplineLength &var) - :VCurveLength(var) -{} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineLength &VSplineLength::operator=(const VSplineLength &var) -{ - if ( &var == this ) - { - return *this; - } - VCurveLength::operator=(var); - return *this; -} - -//--------------------------------------------------------------------------------------------------------------------- -VSplineLength::~VSplineLength() -{} diff --git a/src/libs/vpatterndb/variables/vsplinelength.h b/src/libs/vpatterndb/variables/vsplinelength.h deleted file mode 100644 index 742a2b4ce..000000000 --- a/src/libs/vpatterndb/variables/vsplinelength.h +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************ - ** - ** @file vlengthspline.h - ** @author Roman Telezhynskyi - ** @date 28 7, 2014 - ** - ** @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-2015 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 VSPLINESLENGTH_H -#define VSPLINESLENGTH_H - -#include "vcurvelength.h" - -class VAbstractCurve; - -class VSplineLength :public VCurveLength -{ -public: - VSplineLength(); - VSplineLength(const quint32 &id, const quint32 &parentId, const QString &name, const qreal &value); - VSplineLength(const quint32 &id, const quint32 &parentId, const VAbstractCurve *path, Unit patternUnit); - VSplineLength(const VSplineLength &var); - VSplineLength &operator=(const VSplineLength &var); - virtual ~VSplineLength() Q_DECL_OVERRIDE; -}; - -#endif // VSPLINELENGTH_H diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index 2fa5dbae7..a20b104b0 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -265,13 +265,11 @@ void VContainer::ClearForFullParse() d->details.clear(); ClearVariables(VarType::Increment); - ClearVariables(VarType::ArcLength); ClearVariables(VarType::LineAngle); ClearVariables(VarType::LineLength); - ClearVariables(VarType::SplineLength); + ClearVariables(VarType::CurveLength); ClearVariables(VarType::ArcRadius); - ClearVariables(VarType::ArcAngle); - ClearVariables(VarType::SplineAngle); + ClearVariables(VarType::CurveAngle); ClearGObjects(); ClearUniqueNames(); } @@ -374,16 +372,30 @@ void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPoint //--------------------------------------------------------------------------------------------------------------------- void VContainer::AddArc(const QSharedPointer &arc, const quint32 &id, const quint32 &parentId) { - VArcLength *length = new VArcLength(id, parentId, arc.data(), *GetPatternUnit()); - AddVariable(length->GetName(), length); + AddCurve(arc, id, parentId); VArcRadius *radius = new VArcRadius(id, parentId, arc.data(), *GetPatternUnit()); AddVariable(radius->GetName(), radius); +} - VArcAngle *startAngle = new VArcAngle(id, parentId, arc.data(), CurveAngle::StartAngle); +//--------------------------------------------------------------------------------------------------------------------- +void VContainer::AddCurve(const QSharedPointer &curve, const quint32 &id, const quint32 &parentId) +{ + const GOType curveType = curve->getType(); + if (curveType != GOType::Spline && curveType != GOType::SplinePath && + curveType != GOType::CubicBezier && curveType != GOType::CubicBezierPath && + curveType != GOType::Arc) + { + throw VException(tr("Can't create a curve with type '%1'").arg(static_cast(curveType))); + } + + VCurveLength *length = new VCurveLength(id, parentId, curve.data(), *GetPatternUnit()); + AddVariable(length->GetName(), length); + + VCurveAngle *startAngle = new VCurveAngle(id, parentId, curve.data(), CurveAngle::StartAngle); AddVariable(startAngle->GetName(), startAngle); - VArcAngle *endAngle = new VArcAngle(id, parentId, arc.data(), CurveAngle::EndAngle); + VCurveAngle *endAngle = new VCurveAngle(id, parentId, curve.data(), CurveAngle::EndAngle); AddVariable(endAngle->GetName(), endAngle); } @@ -472,15 +484,9 @@ const QMap > VContainer::DataLengthLines() } //--------------------------------------------------------------------------------------------------------------------- -const QMap > VContainer::DataLengthSplines() const +const QMap > VContainer::DataLengthCurves() const { - return DataVar(VarType::SplineLength); -} - -//--------------------------------------------------------------------------------------------------------------------- -const QMap > VContainer::DataLengthArcs() const -{ - return DataVar(VarType::ArcLength); + return DataVar(VarType::CurveLength); } //--------------------------------------------------------------------------------------------------------------------- @@ -496,15 +502,9 @@ const QMap > VContainer::DataRadiusesArcs() } //--------------------------------------------------------------------------------------------------------------------- -const QMap > VContainer::DataAnglesArcs() const +const QMap > VContainer::DataAnglesCurves() const { - return DataVar(VarType::ArcAngle); -} - -//--------------------------------------------------------------------------------------------------------------------- -const QMap > VContainer::DataAnglesCurves() const -{ - return DataVar(VarType::SplineAngle); + return DataVar(VarType::CurveAngle); } //--------------------------------------------------------------------------------------------------------------------- @@ -672,23 +672,3 @@ const QHash > *VContainer::DataVariab //--------------------------------------------------------------------------------------------------------------------- VContainerData::~VContainerData() {} - -//--------------------------------------------------------------------------------------------------------------------- -void VContainer::AddCurve(const QSharedPointer &curve, const quint32 &id, const quint32 &parentId) -{ - const GOType curveType = curve->getType(); - if (curveType != GOType::Spline && curveType != GOType::SplinePath && - curveType != GOType::CubicBezier && curveType != GOType::CubicBezierPath) - { - throw VException(tr("Can't create a curve with type %1").arg(static_cast(curveType))); - } - - VSplineLength *length = new VSplineLength(id, parentId, curve.data(), *GetPatternUnit()); - AddVariable(length->GetName(), length); - - VSplineAngle *startAngle = new VSplineAngle(id, parentId, curve.data(), CurveAngle::StartAngle); - AddVariable(startAngle->GetName(), startAngle); - - VSplineAngle *endAngle = new VSplineAngle(id, parentId, curve.data(), CurveAngle::EndAngle); - AddVariable(endAngle->GetName(), endAngle); -} diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index c31921bd4..acce78262 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -153,15 +153,13 @@ public: const QHash *DataDetails() const; const QHash> *DataVariables() const; - const QMap > DataMeasurements() const; - const QMap > DataIncrements() const; - const QMap > DataLengthLines() const; - const QMap > DataLengthSplines() const; - const QMap > DataLengthArcs() const; - const QMap > DataAngleLines() const; - const QMap > DataRadiusesArcs() const; - const QMap > DataAnglesArcs() const; - const QMap > DataAnglesCurves() const; + const QMap > DataMeasurements() const; + const QMap > DataIncrements() const; + const QMap > DataLengthLines() const; + const QMap > DataLengthCurves() const; + const QMap > DataAngleLines() const; + const QMap > DataRadiusesArcs() const; + const QMap > DataAnglesCurves() const; const QHash PlainVariables() const; diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index f0c9aaff1..a9b035682 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -7,8 +7,6 @@ SOURCES += \ $$PWD/vdetail.cpp \ $$PWD/vnodedetail.cpp \ $$PWD/vtranslatevars.cpp \ - $$PWD/variables/varcangle.cpp \ - $$PWD/variables/varclength.cpp \ $$PWD/variables/varcradius.cpp \ $$PWD/variables/vcurveangle.cpp \ $$PWD/variables/vcurvelength.cpp \ @@ -18,8 +16,6 @@ SOURCES += \ $$PWD/variables/vlineangle.cpp \ $$PWD/variables/vlinelength.cpp \ $$PWD/variables/vmeasurement.cpp \ - $$PWD/variables/vsplineangle.cpp \ - $$PWD/variables/vsplinelength.cpp \ $$PWD/variables/vvariable.cpp \ $$PWD/vformula.cpp @@ -35,8 +31,6 @@ HEADERS += \ $$PWD/vnodedetail.h \ $$PWD/vnodedetail_p.h \ $$PWD/vtranslatevars.h \ - $$PWD/variables/varcangle.h \ - $$PWD/variables/varclength.h \ $$PWD/variables/varcradius.h \ $$PWD/variables/varcradius_p.h \ $$PWD/variables/vcurveangle.h \ @@ -53,8 +47,6 @@ HEADERS += \ $$PWD/variables/vlinelength_p.h \ $$PWD/variables/vmeasurement.h \ $$PWD/variables/vmeasurement_p.h \ - $$PWD/variables/vsplineangle.h \ - $$PWD/variables/vsplinelength.h \ $$PWD/variables/vvariable.h \ $$PWD/variables/vvariable_p.h \ $$PWD/vformula.h diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index 522138e45..847897656 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -142,17 +142,10 @@ void DialogEditWrongFormula::ValChenged(int row) VDomDocument::UnitsToStr(qApp->patternUnit(), true), tr("Line length")); return; } - if (ui->radioButtonLengthArc->isChecked()) - { - SetDescription(item->text(), - *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), - VDomDocument::UnitsToStr(qApp->patternUnit(), true), tr("Arc length")); - return; - } if (ui->radioButtonLengthSpline->isChecked()) { SetDescription(item->text(), - *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), + *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), VDomDocument::UnitsToStr(qApp->patternUnit(), true), tr("Curve length")); return; } @@ -170,17 +163,10 @@ void DialogEditWrongFormula::ValChenged(int row) VDomDocument::UnitsToStr(qApp->patternUnit(), true), tr("Arc radius")); return; } - if (ui->radioButtonAnglesArcs->isChecked()) - { - SetDescription(item->text(), - *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), - degreeSymbol, tr("Arc angle")); - return; - } if (ui->radioButtonAnglesCurves->isChecked()) { SetDescription(item->text(), - *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), + *data->GetVariable(qApp->TrVars()->VarFromUser(item->text()))->GetValue(), degreeSymbol, tr("Curve angle")); return; } @@ -242,13 +228,6 @@ void DialogEditWrongFormula::RadiusArcs() ShowVariable(data->DataRadiusesArcs()); } -//--------------------------------------------------------------------------------------------------------------------- -void DialogEditWrongFormula::AnglesArcs() -{ - ui->checkBoxHideEmpty->setEnabled(false); - ShowVariable(data->DataAnglesArcs()); -} - //--------------------------------------------------------------------------------------------------------------------- void DialogEditWrongFormula::AnglesCurves() { @@ -256,16 +235,6 @@ void DialogEditWrongFormula::AnglesCurves() ShowVariable(data->DataAnglesCurves()); } -//--------------------------------------------------------------------------------------------------------------------- -/** - * @brief LengthArcs show in list lengths of arcs variables - */ -void DialogEditWrongFormula::LengthArcs() -{ - ui->checkBoxHideEmpty->setEnabled(false); - ShowVariable(data->DataLengthArcs()); -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief LengthCurves show in list lengths of curves variables @@ -273,7 +242,7 @@ void DialogEditWrongFormula::LengthArcs() void DialogEditWrongFormula::LengthCurves() { ui->checkBoxHideEmpty->setEnabled(false); - ShowVariable(data->DataLengthSplines()); + ShowVariable(data->DataLengthCurves()); } //--------------------------------------------------------------------------------------------------------------------- @@ -363,12 +332,10 @@ void DialogEditWrongFormula::InitVariables() connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEditWrongFormula::Measurements); connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEditWrongFormula::Increments); connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthLines); - connect(ui->radioButtonLengthArc, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthArcs); connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthCurves); connect(ui->radioButtonAngleLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::AngleLines); connect(ui->checkBoxHideEmpty, &QCheckBox::stateChanged, this, &DialogEditWrongFormula::Measurements); connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, this, &DialogEditWrongFormula::RadiusArcs); - connect(ui->radioButtonAnglesArcs, &QRadioButton::clicked, this, &DialogEditWrongFormula::AnglesArcs); connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, this, &DialogEditWrongFormula::AnglesCurves); } diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h index e127223d7..96ce62c60 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.h +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.h @@ -70,9 +70,7 @@ public slots: void Measurements(); void LengthLines(); void RadiusArcs(); - void AnglesArcs(); void AnglesCurves(); - void LengthArcs(); void LengthCurves(); void AngleLines(); void Increments(); diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui index 50cf5e0c1..835ec161b 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.ui @@ -272,22 +272,6 @@ - - - - true - - - - 0 - 0 - - - - Length of arcs - - - @@ -333,19 +317,6 @@ - - - - - 0 - 0 - - - - Angles of arcs - - - @@ -415,7 +386,6 @@ radioButtonStandardTable radioButtonIncrements radioButtonLengthLine - radioButtonLengthArc radioButtonLengthSpline radioButtonAngleLine checkBoxHideEmpty