diff --git a/ChangeLog.txt b/ChangeLog.txt index 653ecba6b..51c2103b4 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,23 @@ -# Version 0.7.45 (unreleased) +# Version 0.7.47 (unreleased) +- [smart-pattern/valentina#118] Incorrect seam allowance. +- [smart-pattern/valentina#119] Improve tool Point of intersection curves. +- [smart-pattern/valentina#120] Incorrect seam allowance. +- Fix export to DXF AAMA/ASTM. +- [smart-pattern/valentina#121] Incorrect elliptical arc end angle. +- [smart-pattern/valentina#122] Extend piece bounding rect. +- Remember last selected export format. + +# Version 0.7.46 Mar 31, 2021 +- Fix incorrect calculation of value for multisize measurements in Valentina. +- [smart-pattern/valentina#109] Pattern label template placeholder with dimension label value. +- Incorrect duplication of a piece. Missing restoring pins. +- [smart-pattern/valentina#112] Incorrect seam allowance. +- [smart-pattern/valentina#113] Incorrect seam allowance. +- [smart-pattern/valentina#114] Incorrect seam allowance. +- Fixed bugs. +- Updated translations. + +# Version 0.7.45 Feb 26, 2021 - Fix incorrect seam allowance for angle type second edge right angle. - Fix regression with country flags. - Fix bug in seam allowance. diff --git a/appveyor.yml b/appveyor.yml index c5961a32b..ca4c6877a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -258,7 +258,7 @@ deploy: package: valentina-win_auto-upload publish: true override: true - version: 0.7.44 + version: 0.7.46 on: DEPLOY: true artifact: valentina-win-$(QT_VERSION)-$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT) diff --git a/dist/OBS_debian/debian.changelog b/dist/OBS_debian/debian.changelog index d6f2be5b5..1d3a4d70b 100644 --- a/dist/OBS_debian/debian.changelog +++ b/dist/OBS_debian/debian.changelog @@ -1,5 +1,5 @@ -valentina (0.7.44) trusty; urgency=low +valentina (0.7.46) trusty; urgency=low * Auto build. - -- dismine Tue, 09 Feb 2021 19:48:00 +0300 + -- dismine Wed, 31 Mar 2021 17:20:00 +0300 diff --git a/dist/OBS_debian/debian.control b/dist/OBS_debian/debian.control index a7c77f343..0263f7777 100644 --- a/dist/OBS_debian/debian.control +++ b/dist/OBS_debian/debian.control @@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 8.0.0), qtbase5-dev (>= 5.4.0), libqt5svg5-dev (>= 5.4.0), g++ (>= 4.8.0), - qt5-default (>= 5.4.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) diff --git a/dist/debian/changelog b/dist/debian/changelog index d6f2be5b5..1d3a4d70b 100644 --- a/dist/debian/changelog +++ b/dist/debian/changelog @@ -1,5 +1,5 @@ -valentina (0.7.44) trusty; urgency=low +valentina (0.7.46) trusty; urgency=low * Auto build. - -- dismine Tue, 09 Feb 2021 19:48:00 +0300 + -- dismine Wed, 31 Mar 2021 17:20:00 +0300 diff --git a/dist/debian/control b/dist/debian/control index a7c77f343..0263f7777 100644 --- a/dist/debian/control +++ b/dist/debian/control @@ -6,7 +6,6 @@ Build-Depends: debhelper (>= 8.0.0), qtbase5-dev (>= 5.4.0), libqt5svg5-dev (>= 5.4.0), g++ (>= 4.8.0), - qt5-default (>= 5.4.0), qttools5-dev-tools (>= 5.4.0), libqt5xmlpatterns5-dev (>= 5.4.0), libqt5opengl5-dev (>= 5.4.0) diff --git a/dist/macx/tape/Info.plist b/dist/macx/tape/Info.plist index e3b8ef395..412745612 100755 --- a/dist/macx/tape/Info.plist +++ b/dist/macx/tape/Info.plist @@ -19,9 +19,9 @@ CFBundleIdentifier io.bitbucket.valentinaproject.@EXECUTABLE@ CFBundleShortVersionString - 0.7.44 + 0.7.46 CFBundleVersion - 0.7.44.0 + 0.7.46.0 CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes diff --git a/dist/macx/valentina/Info.plist b/dist/macx/valentina/Info.plist index 5df04cdb7..29516c1e8 100755 --- a/dist/macx/valentina/Info.plist +++ b/dist/macx/valentina/Info.plist @@ -19,9 +19,9 @@ CFBundleIdentifier io.bitbucket.valentinaproject.@EXECUTABLE@ CFBundleShortVersionString - 0.7.44 + 0.7.46 CFBundleVersion - 0.7.44.0 + 0.7.46.0 CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes diff --git a/dist/rpm/_service b/dist/rpm/_service index 0944db026..c11edecb4 100644 --- a/dist/rpm/_service +++ b/dist/rpm/_service @@ -1,7 +1,7 @@ git://github.com/dismine/Valentina_git.git - 0.7.44 + 0.7.46 valentina git .git diff --git a/dist/rpm/valentina.spec b/dist/rpm/valentina.spec index 6c8bf7ef3..08263cbc9 100644 --- a/dist/rpm/valentina.spec +++ b/dist/rpm/valentina.spec @@ -95,7 +95,7 @@ Requires: poppler-tools Requires: poppler-utils %endif -Version: 0.7.44 +Version: 0.7.46 Release: 0 URL: https://gitlab.com/smart-pattern/valentina License: GPL-3.0+ diff --git a/dist/valentina.dsc b/dist/valentina.dsc index 9d0612e54..33a6e09c2 100644 --- a/dist/valentina.dsc +++ b/dist/valentina.dsc @@ -2,11 +2,11 @@ Format: 3.0 (native) Source: valentina Binary: valentina Architecture: i386 amd64 -Version: 0.7.44 +Version: 0.7.46 Maintainer: Roman Telezhynskyi Homepage: https://valentinaproject.bitbucket.io Standards-Version: 3.9.5 -Vcs-Browser: https://bitbucket.org/dismine/valentina +Vcs-Browser: https://gitlab.com/smart-pattern/valentina Build-Depends: debhelper (>= 8.0.0), qtbase5-dev (>= 5.4.0), libqt5svg5-dev (>= 5.4.0), @@ -18,8 +18,8 @@ Build-Depends: debhelper (>= 8.0.0), Package-List: valentina deb graphics optional Checksums-Sha1: - 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.44.tar + 581eb1bf36b4ab7126b5983d809130f15396859e 24838101 valentina_0.7.46.tar Checksums-Sha256: - 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.44.tar + 9b156c7120a69b90373efb8ca9998c3e0563a60ad337210166cfd41b00b0f13c 24838101 valentina_0.7.46.tar Files: - 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.44.tar + 95677e29d3a59cf5b064f7be236a4b78 24838101 valentina_0.7.46.tar diff --git a/scripts/lupdate.sh b/scripts/lupdate.sh index 2133d1064..691b9b890 100755 --- a/scripts/lupdate.sh +++ b/scripts/lupdate.sh @@ -43,7 +43,7 @@ do done end=$(date +%s) -runtime=$(python -c "print 'Time passed %u:%02u seconds' % ((${end} - ${start})/60, (${end} - ${start})%60)") +runtime=$(python -c "print('Time passed %u:%02u seconds' % ((${end} - ${start})/60, (${end} - ${start})%60))") echo $runtime echo For updating files run: build all. diff --git a/share/bintray.json b/share/bintray.json index 0632e5153..3066445f8 100644 --- a/share/bintray.json +++ b/share/bintray.json @@ -15,10 +15,10 @@ }, "version": { - "name": "0.7.44", + "name": "0.7.46", "desc": "Test branch release", - "released": "2021-02-09", - "vcs_tag": "v0.7.44", + "released": "2021-03-31", + "vcs_tag": "v0.7.46", "gpgSign": false }, diff --git a/share/translations/valentina.ts b/share/translations/valentina.ts index 8e4891743..3f011ce73 100644 --- a/share/translations/valentina.ts +++ b/share/translations/valentina.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_cs_CZ.ts b/share/translations/valentina_cs_CZ.ts index def2aa814..f70ce6dc3 100644 --- a/share/translations/valentina_cs_CZ.ts +++ b/share/translations/valentina_cs_CZ.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_de_DE.ts b/share/translations/valentina_de_DE.ts index 82ff41076..823014d39 100644 --- a/share/translations/valentina_de_DE.ts +++ b/share/translations/valentina_de_DE.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_el_GR.ts b/share/translations/valentina_el_GR.ts index 783ccacb8..42dfb854d 100644 --- a/share/translations/valentina_el_GR.ts +++ b/share/translations/valentina_el_GR.ts @@ -2066,6 +2066,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_en_CA.ts b/share/translations/valentina_en_CA.ts index 2bf210fa2..950405bd6 100644 --- a/share/translations/valentina_en_CA.ts +++ b/share/translations/valentina_en_CA.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_en_IN.ts b/share/translations/valentina_en_IN.ts index c46dc0cbc..b7e337db2 100644 --- a/share/translations/valentina_en_IN.ts +++ b/share/translations/valentina_en_IN.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_en_US.ts b/share/translations/valentina_en_US.ts index 9af5195b9..4c02a412a 100644 --- a/share/translations/valentina_en_US.ts +++ b/share/translations/valentina_en_US.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_es_ES.ts b/share/translations/valentina_es_ES.ts index d008f903e..57c6a9cdc 100644 --- a/share/translations/valentina_es_ES.ts +++ b/share/translations/valentina_es_ES.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_fi_FI.ts b/share/translations/valentina_fi_FI.ts index ec7e7aa69..9cd3f5c3b 100644 --- a/share/translations/valentina_fi_FI.ts +++ b/share/translations/valentina_fi_FI.ts @@ -1746,6 +1746,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_he_IL.ts b/share/translations/valentina_he_IL.ts index e731e2d1e..25aae0417 100644 --- a/share/translations/valentina_he_IL.ts +++ b/share/translations/valentina_he_IL.ts @@ -1399,6 +1399,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_id_ID.ts b/share/translations/valentina_id_ID.ts index bf238ac80..cd95248a8 100644 --- a/share/translations/valentina_id_ID.ts +++ b/share/translations/valentina_id_ID.ts @@ -1638,6 +1638,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_it_IT.ts b/share/translations/valentina_it_IT.ts index a7beadc39..b68bb76b5 100644 --- a/share/translations/valentina_it_IT.ts +++ b/share/translations/valentina_it_IT.ts @@ -2102,6 +2102,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_pl_PL.ts b/share/translations/valentina_pl_PL.ts index bea54464b..0b2f1f112 100644 --- a/share/translations/valentina_pl_PL.ts +++ b/share/translations/valentina_pl_PL.ts @@ -1942,6 +1942,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_pt_BR.ts b/share/translations/valentina_pt_BR.ts index 13c309eeb..e5e12bfd9 100644 --- a/share/translations/valentina_pt_BR.ts +++ b/share/translations/valentina_pt_BR.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_ro_RO.ts b/share/translations/valentina_ro_RO.ts index f55b7f635..faae77220 100644 --- a/share/translations/valentina_ro_RO.ts +++ b/share/translations/valentina_ro_RO.ts @@ -1911,6 +1911,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_ru_RU.ts b/share/translations/valentina_ru_RU.ts index e7b0b6d34..e1ff52330 100644 --- a/share/translations/valentina_ru_RU.ts +++ b/share/translations/valentina_ru_RU.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_uk_UA.ts b/share/translations/valentina_uk_UA.ts index 384c99a5b..b1fe9743f 100644 --- a/share/translations/valentina_uk_UA.ts +++ b/share/translations/valentina_uk_UA.ts @@ -2110,6 +2110,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/share/translations/valentina_zh_CN.ts b/share/translations/valentina_zh_CN.ts index 417c4bcec..635016ffd 100644 --- a/share/translations/valentina_zh_CN.ts +++ b/share/translations/valentina_zh_CN.ts @@ -1559,6 +1559,26 @@ Measurement: %1 + + Height label + dimension + + + + Size label + dimension + + + + Hip label + dimension + + + + Waist label + dimension + + DialogEditWrongFormula diff --git a/src/app/share/collection/bugs/GAVAUDAN Laure - corsage - figure 4.val b/src/app/share/collection/bugs/GAVAUDAN Laure - corsage - figure 4.val deleted file mode 100644 index cf7f9c9c3..000000000 --- a/src/app/share/collection/bugs/GAVAUDAN Laure - corsage - figure 4.val +++ /dev/null @@ -1,111 +0,0 @@ - - - - 0.2.4 - cm - - - - mesures GAVAUDAN Laure.vit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
-
-
diff --git a/src/app/share/collection/bugs/mesures GAVAUDAN Laure.vit b/src/app/share/collection/bugs/mesures GAVAUDAN Laure.vit deleted file mode 100644 index 731a7d553..000000000 --- a/src/app/share/collection/bugs/mesures GAVAUDAN Laure.vit +++ /dev/null @@ -1,53 +0,0 @@ - - - - 0.3.3 - false - - cm - 998 - - Gavaudan - Laure - 2003-10-08 - female - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index b154c4eed..53c89fddd 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -611,6 +611,7 @@ void TMainWindow::changeEvent(QEvent *event) InitDimensionsBaseValue(); InitDimensionControls(); InitDimesionShifts(); + RetranslateTableHeaders(); } else { @@ -2874,36 +2875,7 @@ void TMainWindow::InitTable() { ui->tableWidget->setColumnHidden( ColumnFormula, true );// formula - const QList< MeasurementDimension_p > dimensions = m->Dimensions().values(); - - if (dimensions.size() > 0) - { - MeasurementDimension_p dimension = dimensions.at(0); - ui->tableWidget->horizontalHeaderItem(ColumnShiftA)->setText( - tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); - } - - if (dimensions.size() < 2) - { - ui->tableWidget->setColumnHidden( ColumnShiftB, true ); - } - else - { - MeasurementDimension_p dimension = dimensions.at(1); - ui->tableWidget->horizontalHeaderItem(ColumnShiftB)->setText( - tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); - } - - if (dimensions.size() < 3) - { - ui->tableWidget->setColumnHidden( ColumnShiftC, true ); - } - else - { - MeasurementDimension_p dimension = dimensions.at(2); - ui->tableWidget->horizontalHeaderItem(ColumnShiftC)->setText( - tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); - } + RetranslateTableHeaders(); } else { @@ -4452,6 +4424,44 @@ void TMainWindow::InitMeasurementDimension() ui->comboBoxDimension->blockSignals(false); } +//--------------------------------------------------------------------------------------------------------------------- +void TMainWindow::RetranslateTableHeaders() +{ + if (mType == MeasurementsType::Multisize) + { + const QList< MeasurementDimension_p > dimensions = m->Dimensions().values(); + + if (not dimensions.isEmpty()) + { + const MeasurementDimension_p& dimension = dimensions.at(0); + ui->tableWidget->horizontalHeaderItem(ColumnShiftA)->setText( + tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); + } + + if (dimensions.size() < 2) + { + ui->tableWidget->setColumnHidden( ColumnShiftB, true ); + } + else + { + const MeasurementDimension_p &dimension = dimensions.at(1); + ui->tableWidget->horizontalHeaderItem(ColumnShiftB)->setText( + tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); + } + + if (dimensions.size() < 3) + { + ui->tableWidget->setColumnHidden( ColumnShiftC, true ); + } + else + { + const MeasurementDimension_p &dimension = dimensions.at(2); + ui->tableWidget->horizontalHeaderItem(ColumnShiftC)->setText( + tr("%1 shift").arg(VAbstartMeasurementDimension::DimensionName(dimension->Type()))); + } + } +} + //--------------------------------------------------------------------------------------------------------------------- template void TMainWindow::HackWidget(T **widget) diff --git a/src/app/tape/tmainwindow.h b/src/app/tape/tmainwindow.h index 389c0fb54..d8040d6f3 100644 --- a/src/app/tape/tmainwindow.h +++ b/src/app/tape/tmainwindow.h @@ -190,6 +190,8 @@ private: void InitGender(QComboBox *gender); void InitMeasurementDimension(); + void RetranslateTableHeaders(); + void ShowNewMData(bool fresh); void ShowUnits(); void ShowHeaderUnits(QTableWidget *table, int column, const QString &unit); diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index dd38d51c9..f23ce0bcf 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -87,8 +87,11 @@ DialogHistory::~DialogHistory() void DialogHistory::DialogAccepted() { QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0); - quint32 id = qvariant_cast(item->data(Qt::UserRole)); - emit ShowHistoryTool(id, false); + if (item != nullptr) + { + auto id = qvariant_cast(item->data(Qt::UserRole)); + emit ShowHistoryTool(id, false); + } emit DialogClosed(QDialog::Accepted); } diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index 0ec1e3f1f..2e9cfdf29 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -927,6 +927,8 @@ void DialogSaveLayout::ReadSettings() { ui->toolButtonLandscape->setChecked(true); } + + SelectFormat(static_cast(settings->GetLayoutExportFormat())); } //--------------------------------------------------------------------------------------------------------------------- @@ -969,5 +971,7 @@ void DialogSaveLayout::WriteSettings() const { settings->SetTiledPDFOrientation(PageOrientation::Landscape); } + + settings->SetLayoutExportFormat(static_cast(Format())); } diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 321b68acb..59fdf8b22 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -555,20 +555,7 @@ bool MainWindow::LoadMeasurements(const QString &path) return false; } - if (m->Type() == MeasurementsType::Multisize) - { - StoreMultisizeMDimensions(); - - doc->SetPatternWasChanged(true); - emit doc->UpdatePatternLabel(); - } - else if (m->Type() == MeasurementsType::Individual) - { - StoreIndividualMDimensions(); - - doc->SetPatternWasChanged(true); - emit doc->UpdatePatternLabel(); - } + StoreDimensions(); return true; } @@ -623,20 +610,7 @@ bool MainWindow::UpdateMeasurements(const QString &path, qreal baseA, qreal base return false; } - if (m->Type() == MeasurementsType::Multisize) - { - StoreMultisizeMDimensions(); - doc->SetPatternWasChanged(true); - emit doc->UpdatePatternLabel(); - } - else if (m->Type() == MeasurementsType::Individual) - { - StoreIndividualMDimensions(); - - doc->SetPatternWasChanged(true); - emit doc->UpdatePatternLabel(); - } return true; } @@ -1868,6 +1842,11 @@ void MainWindow::UnloadMeasurements() VAbstractValApplication::VApp()->SetDimensionHip(0); VAbstractValApplication::VApp()->SetDimensionWaist(0); + VAbstractValApplication::VApp()->SetDimensionHeightLabel(QString()); + VAbstractValApplication::VApp()->SetDimensionSizeLabel(QString()); + VAbstractValApplication::VApp()->SetDimensionHipLabel(QString()); + VAbstractValApplication::VApp()->SetDimensionWaistLabel(QString()); + if (oldType == MeasurementsType::Multisize) { m_currentDimensionA = 0; @@ -1999,6 +1978,7 @@ void MainWindow::SyncMeasurements() statusBar()->showMessage(msg, 5000); VWidgetPopup::PopupMessage(this, msg); doc->LiteParseTree(Document::FullLiteParse); + StoreDimensions(); mChanges = false; mChangesAsked = true; measurementsSyncTimer->stop(); @@ -2093,16 +2073,21 @@ void MainWindow::StoreMultisizeMDimensions() if (dimensions.size() > index) { const MeasurementDimension_p& dimension = dimensions.at(index); + const DimesionLabels labels = dimension->Labels(); switch(dimension->Type()) { case MeasurementDimension::X: VAbstractValApplication::VApp()->SetDimensionHeight(currentBase); + VAbstractValApplication::VApp()->SetDimensionHeightLabel( + labels.value(currentBase, QString::number(currentBase))); break; case MeasurementDimension::Y: { const bool fc = m->IsFullCircumference(); VAbstractValApplication::VApp()->SetDimensionSize(fc ? currentBase*2 : currentBase); + VAbstractValApplication::VApp()->SetDimensionSizeLabel( + labels.value(currentBase, QString::number(fc ? currentBase*2 : currentBase))); const bool circumference = dimension->IsCircumference(); VAbstractValApplication::VApp() ->SetDimensionSizeUnits(circumference ? m->MUnit() : Unit::LAST_UNIT_DO_NOT_USE); @@ -2112,12 +2097,16 @@ void MainWindow::StoreMultisizeMDimensions() { const bool fc = m->IsFullCircumference(); VAbstractValApplication::VApp()->SetDimensionWaist(fc ? currentBase*2 : currentBase); + VAbstractValApplication::VApp()->SetDimensionWaistLabel( + labels.value(currentBase, QString::number(fc ? currentBase*2 : currentBase))); break; } case MeasurementDimension::Z: { const bool fc = m->IsFullCircumference(); VAbstractValApplication::VApp()->SetDimensionHip(fc ? currentBase*2 : currentBase); + VAbstractValApplication::VApp()->SetDimensionHipLabel( + labels.value(currentBase, QString::number(fc ? currentBase*2 : currentBase))); break; } default: @@ -2140,19 +2129,24 @@ void MainWindow::StoreIndividualMDimensions() { const QString name = VAbstractApplication::VApp()->TrVars()->VarToUser(m->MeasurementForDimension(type)); const bool valid = not name.isEmpty() && measurements.contains(name); + const qreal value = valid ? *measurements.value(name)->GetValue() : 0; switch(type) { case IMD::X: - VAbstractValApplication::VApp()->SetDimensionHeight(valid ? *measurements.value(name)->GetValue() : 0); + VAbstractValApplication::VApp()->SetDimensionHeight(value); + VAbstractValApplication::VApp()->SetDimensionHeightLabel(QString::number(value)); break; case IMD::Y: - VAbstractValApplication::VApp()->SetDimensionSize(valid ? *measurements.value(name)->GetValue() : 0); + VAbstractValApplication::VApp()->SetDimensionSize(value); + VAbstractValApplication::VApp()->SetDimensionSizeLabel(QString::number(value)); break; case IMD::W: - VAbstractValApplication::VApp()->SetDimensionWaist(valid ? *measurements.value(name)->GetValue() : 0); + VAbstractValApplication::VApp()->SetDimensionWaist(value); + VAbstractValApplication::VApp()->SetDimensionWaistLabel(QString::number(value)); break; case IMD::Z: - VAbstractValApplication::VApp()->SetDimensionHip(valid ? *measurements.value(name)->GetValue() : 0); + VAbstractValApplication::VApp()->SetDimensionHip(value); + VAbstractValApplication::VApp()->SetDimensionHipLabel(QString::number(value)); break; case IMD::N: default: @@ -2231,6 +2225,25 @@ void MainWindow::SetDimensionBases() SetBase(2, dimensionC, m_currentDimensionC); } +//--------------------------------------------------------------------------------------------------------------------- +void MainWindow::StoreDimensions() +{ + if (m->Type() == MeasurementsType::Multisize) + { + StoreMultisizeMDimensions(); + + doc->SetPatternWasChanged(true); + emit doc->UpdatePatternLabel(); + } + else if (m->Type() == MeasurementsType::Individual) + { + StoreIndividualMDimensions(); + + doc->SetPatternWasChanged(true); + emit doc->UpdatePatternLabel(); + } +} + //--------------------------------------------------------------------------------------------------------------------- #if defined(Q_OS_MAC) void MainWindow::OpenAt(QAction *where) @@ -3569,6 +3582,7 @@ void MainWindow::Clear() ui->actionLoadWatermark->setEnabled(false); ui->actionRemoveWatermark->setEnabled(false); ui->actionEditCurrentWatermark->setEnabled(false); + PatternChangesWereSaved(true); } //--------------------------------------------------------------------------------------------------------------------- @@ -4075,6 +4089,7 @@ void MainWindow::GradationChanged() m_currentDimensionA, m_currentDimensionB, m_currentDimensionC)) { doc->LiteParseTree(Document::FullLiteParse); + StoreDimensions(); emit sceneDetails->DimensionsChanged(); } else diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 7b49dfe7f..487f564b4 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -417,6 +417,8 @@ private: QVector DimensionRestrictedValues(int index, const MeasurementDimension_p &dimension); void SetDimensionBases(); + + void StoreDimensions(); }; #endif // MAINWINDOW_H diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index ce70dab41..2cc23e5bc 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -690,6 +690,13 @@ void VPattern::customEvent(QEvent *event) } } +//--------------------------------------------------------------------------------------------------------------------- +void VPattern::Clear() +{ + m_parsing = true; + VAbstractPattern::Clear(); +} + //--------------------------------------------------------------------------------------------------------------------- VNodeDetail VPattern::ParseDetailNode(const QDomElement &domElement) const { @@ -1368,7 +1375,7 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do try { VToolLineInitData initData; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.firstPoint = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); initData.secondPoint = GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); initData.typeLine = GetParametrString(domElement, AttrTypeLine, TypeLineLine); @@ -2491,7 +2498,7 @@ void VPattern::ParseToolTrueDarts(VMainGraphicsScene *scene, const QDomElement & initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.p1id = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); initData.p2id = GetParametrUInt(domElement, AttrPoint2, NULL_ID_STR); @@ -2542,7 +2549,7 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, QDomElement &domEle initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); const quint32 point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); const quint32 point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR); const qreal angle1 = GetParametrDouble(domElement, AttrAngle1, QStringLiteral("270.0")); @@ -2591,7 +2598,7 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); initData.point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR); @@ -2663,7 +2670,7 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); const quint32 point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); const quint32 point2 = GetParametrUInt(domElement, AttrPoint2, NULL_ID_STR); @@ -2717,7 +2724,7 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, QDomElement &do initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, QStringLiteral("1.0")); const QString color = GetParametrString(domElement, AttrColor, ColorBlack); const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); @@ -2789,7 +2796,7 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.color = GetParametrString(domElement, AttrColor, ColorBlack); initData.penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); initData.duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); @@ -2883,7 +2890,7 @@ void VPattern::ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomEle initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); const QString color = GetParametrString(domElement, AttrColor, ColorBlack); const QString penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); @@ -3043,7 +3050,7 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.radius = GetParametrString(domElement, AttrRadius, QStringLiteral("10")); const QString r = initData.radius;//need for saving fixed formula; @@ -3096,7 +3103,7 @@ void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &do initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.radius1 = GetParametrString(domElement, AttrRadius1, QStringLiteral("10")); initData.radius2 = GetParametrString(domElement, AttrRadius2, QStringLiteral("10")); @@ -3234,7 +3241,7 @@ void VPattern::ParseToolArcWithLength(VMainGraphicsScene *scene, QDomElement &do initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.radius = GetParametrString(domElement, AttrRadius, QStringLiteral("10")); const QString r = initData.radius;//need for saving fixed formula; @@ -3287,7 +3294,7 @@ void VPattern::ParseToolRotation(VMainGraphicsScene *scene, QDomElement &domElem initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.origin = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.angle = GetParametrString(domElement, AttrAngle, QStringLiteral("10")); const QString a = initData.angle;//need for saving fixed formula; @@ -3397,7 +3404,7 @@ void VPattern::ParseToolMove(VMainGraphicsScene *scene, QDomElement &domElement, initData.parse = parse; initData.typeCreation = Source::FromFile; - ToolsCommonAttributes(domElement, initData.id); + DrawToolsCommonAttributes(domElement, initData.id, initData.notes); initData.formulaAngle = GetParametrString(domElement, AttrAngle, QChar('0')); const QString a = initData.formulaAngle;//need for saving fixed formula; initData.formulaRotationAngle = GetParametrString(domElement, AttrRotationAngle, QChar('0')); diff --git a/src/app/valentina/xml/vpattern.h b/src/app/valentina/xml/vpattern.h index 51cc84c9b..97c182852 100644 --- a/src/app/valentina/xml/vpattern.h +++ b/src/app/valentina/xml/vpattern.h @@ -98,6 +98,7 @@ public: virtual QString GenerateLabel(const LabelType &type, const QString &reservedName = QString())const override; virtual QString GenerateSuffix() const override; + virtual void Clear() override; bool IsReadOnly() const; void SetReadOnly(bool rOnly); diff --git a/src/libs/qmuparser/qmuparserbase.h b/src/libs/qmuparser/qmuparserbase.h index 9f0282890..96f06b9b3 100644 --- a/src/libs/qmuparser/qmuparserbase.h +++ b/src/libs/qmuparser/qmuparserbase.h @@ -22,7 +22,7 @@ #ifndef QMUQPARSERBASE_H #define QMUQPARSERBASE_H -#include +#include #include #include #include diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index 8e7139531..7badba13a 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -714,7 +714,7 @@ void VDxfEngine::ExportAAMAOutline(dx_ifaceBlock *detailBlock, const VLayoutPiec //--------------------------------------------------------------------------------------------------------------------- void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) { - if (not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn()) + if (detail.IsSeamAllowance() && not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn()) { if (DRW_Entity *e = AAMAPolygon(detail.GetMappedContourPoints(), QChar('8'), true)) { @@ -927,7 +927,7 @@ void VDxfEngine::ExportASTMPieceBoundary(dx_ifaceBlock *detailBlock, const VLayo //--------------------------------------------------------------------------------------------------------------------- void VDxfEngine::ExportASTMSewLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) { - if (not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn()) + if (detail.IsSeamAllowance() && not detail.IsHideMainPath() && not detail.IsSeamAllowanceBuiltIn()) { QVector sewLine = detail.GetMappedContourPoints(); diff --git a/src/libs/vgeometry/vellipticalarc.cpp b/src/libs/vgeometry/vellipticalarc.cpp index 5db2a4b95..a616055cd 100644 --- a/src/libs/vgeometry/vellipticalarc.cpp +++ b/src/libs/vgeometry/vellipticalarc.cpp @@ -290,7 +290,7 @@ QVector VEllipticalArc::GetPoints() const QLineF endLine = startLine; startLine.setAngle(VAbstractArc::GetStartAngle()); - endLine.setAngle(VAbstractArc::GetEndAngle()); + endLine.setAngle(RealEndAngle()); qreal sweepAngle = startLine.angleTo(endLine); if (qFuzzyIsNull(sweepAngle)) @@ -508,6 +508,26 @@ QPointF VEllipticalArc::GetP(qreal angle) const return line2.p2() + VAbstractArc::GetCenter().toQPointF(); } +//--------------------------------------------------------------------------------------------------------------------- +qreal VEllipticalArc::RealEndAngle() const +{ + qreal endAngle = VEllipticalArc::OptimizeAngle(VAbstractArc::GetEndAngle()); + + if (qFuzzyIsNull(endAngle) || + VFuzzyComparePossibleNulls(endAngle, 90) || + VFuzzyComparePossibleNulls(endAngle, 180) || + VFuzzyComparePossibleNulls(endAngle, 270) || + VFuzzyComparePossibleNulls(endAngle, 360)) + { + return endAngle; + } + + endAngle = qRadiansToDegrees(qAtan2(d->radius1 * qSin(qDegreesToRadians(endAngle)), + d->radius2 * qCos(qDegreesToRadians(endAngle)))); + + return endAngle; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief GetFormulaRadius1 return formula for major radius. diff --git a/src/libs/vgeometry/vellipticalarc.h b/src/libs/vgeometry/vellipticalarc.h index 2c23ca104..481afcfaf 100644 --- a/src/libs/vgeometry/vellipticalarc.h +++ b/src/libs/vgeometry/vellipticalarc.h @@ -112,6 +112,8 @@ private: qreal MaxLength() const; QPointF GetP(qreal angle) const; + + qreal RealEndAngle() const; }; Q_DECLARE_METATYPE(VEllipticalArc) diff --git a/src/libs/vgeometry/vgeometrydef.h b/src/libs/vgeometry/vgeometrydef.h index fc59a9a36..f6329762b 100644 --- a/src/libs/vgeometry/vgeometrydef.h +++ b/src/libs/vgeometry/vgeometrydef.h @@ -97,7 +97,7 @@ private: }; Q_DECLARE_METATYPE(VLayoutPassmark) -constexpr qreal accuracyPointOnLine = (0.126/*mm*/ / 25.4) * PrintDPI; +constexpr qreal accuracyPointOnLine = (0.138/*mm*/ / 25.4) * PrintDPI; Q_REQUIRED_RESULT static inline bool VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, qreal accuracy = accuracyPointOnLine); diff --git a/src/libs/vlayout/testpath.cpp b/src/libs/vlayout/testpath.cpp index 0374c4b2c..3a7eb8f78 100644 --- a/src/libs/vlayout/testpath.cpp +++ b/src/libs/vlayout/testpath.cpp @@ -28,7 +28,6 @@ #include "testpath.h" #include -#include #include #include #include @@ -40,7 +39,7 @@ //--------------------------------------------------------------------------------------------------------------------- #if !defined(V_NO_ASSERT) // Use for writing tests -QJsonObject PointToJson(const QPointF &point) +auto PointToJson(const QPointF &point) -> QJsonObject { QJsonObject pointObject { @@ -62,15 +61,4 @@ void VectorToJson(const QVector &points, QJsonObject &json) json[QLatin1String("vector")] = pointsArray; } -//--------------------------------------------------------------------------------------------------------------------- -void VectorToJson(const QVector &points, QJsonObject &json) -{ - QJsonArray pointsArray; - for (auto point: points) - { - pointsArray.append(point.toJson()); - } - json[QLatin1String("vector")] = pointsArray; -} - #endif // !defined(V_NO_ASSERT) diff --git a/src/libs/vlayout/testpath.h b/src/libs/vlayout/testpath.h index b3e92c01b..5ecdc4d57 100644 --- a/src/libs/vlayout/testpath.h +++ b/src/libs/vlayout/testpath.h @@ -30,20 +30,23 @@ #include #include +#include #include #include #include #include class QPointF; -class QJsonObject; template class QVector; class VSAPoint; +class VRawSAPoint; #if !defined(V_NO_ASSERT) QJsonObject PointToJson(const QPointF &point); void VectorToJson(const QVector &points, QJsonObject &json); -void VectorToJson(const QVector &points, QJsonObject &json); + +template +void VectorToJson(const QVector &points, QJsonObject &json); //--------------------------------------------------------------------------------------------------------------------- template @@ -78,6 +81,17 @@ void DumpVector(const QVector &points, const QString &templateName=QString()) out.flush(); } } -#endif // !defined(V_NO_ASSERT) +//--------------------------------------------------------------------------------------------------------------------- +template +void VectorToJson(const QVector &points, QJsonObject &json) +{ + QJsonArray pointsArray; + for (auto point: points) + { + pointsArray.append(point.toJson()); + } + json[QLatin1String("vector")] = pointsArray; +} +#endif // !defined(V_NO_ASSERT) #endif // TESTPATH_H diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index 729e408fa..0c8aad32f 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -596,39 +596,41 @@ QVector AngleBySecondRightAngle(QVector points, QPoint { return AngleByLength(points, p1, p2, p3, bigLine1, sp2, bigLine2, p, width, needRollback); } + + // Because artificial loop can lead to wrong clipping we must rollback current seam allowance points + bool success = false; + const int countBefore = points.size(); + QVector temp = points; + temp.append(bigLine1.p2()); + temp = VAbstractPiece::RollbackSeamAllowance(temp, edge, &success); + + if (success) + { + points = temp; + px = points.last(); + } + + if (countBefore > 0) + { + QLineF seam(px, p3); + seam.setAngle(seam.angle()+90); + seam.setLength(p.GetSAAfter(width)); + points.append(seam.p2()); + } else { - // Because artificial loop can lead to wrong clipping we must rollback current seam allowance points - bool success = false; - const int countBefore = points.size(); - QVector temp = points; - temp.append(bigLine1.p2()); - temp = VAbstractPiece::RollbackSeamAllowance(temp, edge, &success); - - if (success) + if (needRollback != nullptr) { - points = temp; + *needRollback = not success; } - - if (success) - { - px = points.last(); - } - - if (countBefore > 0) + else if (IsSameDirection(bigLine1.p1(), bigLine1.p2(), px)) { + points.append(px); QLineF seam(px, p3); seam.setAngle(seam.angle()+90); seam.setLength(p.GetSAAfter(width)); points.append(seam.p2()); } - else - { - if (needRollback != nullptr) - { - *needRollback = not success; - } - } } } @@ -895,7 +897,7 @@ QVector CleanLoopArtifacts(const QVector &points) { QVector cleaned; cleaned.reserve(points.size()); - for (auto &point : points) + for (const auto &point : points) { if (not point.LoopPoint()) { @@ -1211,72 +1213,50 @@ QVector VAbstractPiece::CheckLoops(const QVector &points) * @param points vector of points of equidistant. * @return vector of points of equidistant. */ -QVector VAbstractPiece::CheckLoops(const QVector &points) +auto VAbstractPiece::CheckLoops(const QVector &points) -> QVector { -// DumpVector(points); // Uncomment for dumping test data +// DumpVector(points, QStringLiteral("input.json.XXXXXX")); // Uncomment for dumping test data - int count = points.size(); /*If we got less than 4 points no need seek loops.*/ - if (count < 4) + if (points.size() < 4) { return CleanLoopArtifacts(points); } - const bool pathClosed = (points.first() == points.last()); + bool loopFound = false; - QVector ekvPoints; - ekvPoints.reserve(points.size()); - - QVector uniqueVertices; - uniqueVertices.reserve(4); - - qint32 i, j, jNext = 0; - for (i = 0; i < count; ++i) + auto CheckLoop = [&loopFound](const QVector &points) { - /*Last three points no need to check.*/ - /*Triangle can not contain a loop*/ - if (i > count-3) + loopFound = false; + + const bool pathClosed = (points.first() == points.last()); + + QVector ekvPoints; + ekvPoints.reserve(points.size()); + + qint32 i; + for (i = 0; i < points.size(); ++i) { - ekvPoints.append(points.at(i)); - continue; - } - - enum LoopIntersectType { NoIntersection, BoundedIntersection, ParallelIntersection }; - - QPointF crosPoint; - LoopIntersectType status = NoIntersection; - const QLineF line1(points.at(i), points.at(i+1)); - // Because a path can contains several loops we will seek the last and only then remove the loop(s) - // That's why we parse from the end - for (j = count-1; j >= i+2; --j) - { - j == count-1 ? jNext = 0 : jNext = j+1; - QLineF line2(points.at(j), points.at(jNext)); - - if(qFuzzyIsNull(line2.length())) - {//If a path is closed the edge (count-1;0) length will be 0 + /*Last three points no need to check.*/ + /*Triangle can not contain a loop*/ + if (loopFound || i > points.size()-4) + { + ekvPoints.append(points.at(i)); continue; } - uniqueVertices.clear(); + enum LoopIntersectType { NoIntersection, BoundedIntersection, ParallelIntersection }; - auto AddUniqueIndex = [&uniqueVertices](qint32 i) + QPointF crosPoint; + LoopIntersectType status = NoIntersection; + const QLineF line1(points.at(i), points.at(i+1)); + + const int limit = pathClosed && i == 0 ? 2 : 1; + qint32 j; + for (j = i+2; j < points.size()-limit; ++j) { - if (not uniqueVertices.contains(i)) - { - uniqueVertices.append(i); - } - }; + QLineF line2(points.at(j), points.at(j+1)); - AddUniqueIndex(i); - AddUniqueIndex(i+1); - AddUniqueIndex(j); - - // For closed path last point is equal to first. Using index of the first. - pathClosed && jNext == count-1 ? AddUniqueIndex(0) : AddUniqueIndex(jNext); - - if (uniqueVertices.size() == 4) - {// Lines are not neighbors const QLineF::IntersectType intersect = Intersects(line1, line2, &crosPoint); if (intersect == QLineF::NoIntersection) { // According to the documentation QLineF::NoIntersection indicates that the lines do not intersect; @@ -1294,32 +1274,48 @@ QVector VAbstractPiece::CheckLoops(const QVector &points) break; } } - status = NoIntersection; - } - switch (status) - { - case ParallelIntersection: - /*We have found a loop.*/ - ekvPoints.append(points.at(i)); - ekvPoints.append(points.at(jNext)); - jNext > j ? i = jNext : i = j; // Skip a loop - break; - case BoundedIntersection: - ekvPoints.append(points.at(i)); - ekvPoints.append(crosPoint); - i = j; - break; - case NoIntersection: - /*We have not found loop.*/ - ekvPoints.append(points.at(i)); - break; - default: - break; + switch (status) + { + case ParallelIntersection: + /*We have found a loop.*/ + ekvPoints.append(points.at(i)); + ekvPoints.append(points.at(j+1)); + i = j+1; // Skip a loop + loopFound = true; + break; + case BoundedIntersection: + ekvPoints.append(points.at(i)); + ekvPoints.append(crosPoint); + i = j; + loopFound = true; + break; + case NoIntersection: + /*We have not found loop.*/ + ekvPoints.append(points.at(i)); + break; + default: + break; + } } - } + return ekvPoints; + }; + + QVector ekvPoints = points; + qint32 i; + const int maxLoops = 10000; // limit number of loops to be removed + + for (i = 0; i < maxLoops; ++i) + { + ekvPoints = CheckLoop(ekvPoints); + if (not loopFound) + { + break; + } + } + const QVector cleaned = CleanLoopArtifacts(ekvPoints); -// DumpVector(cleaned); // Uncomment for dumping test data +// DumpVector(cleaned, QStringLiteral("output.json.XXXXXX")); // Uncomment for dumping test data return cleaned; } @@ -1945,12 +1941,15 @@ QPainterPath VAbstractPiece::PainterPath(const QVector &points) QPainterPath path; path.setFillRule(Qt::WindingFill); - path.moveTo(points.at(0)); - for (qint32 i = 1; i < points.count(); ++i) + if (not points.isEmpty()) { - path.lineTo(points.at(i)); + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); } - path.lineTo(points.at(0)); return path; } diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index a0ad89778..aa6e7edf7 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -250,14 +250,15 @@ QVector VAbstractPiece::RemoveDublicates(const QVector &points, bool remov { if (VFuzzyComparePoints(p.at(i), p.at(i+1))) { - if (not removeFirstAndLast && (i == p.size()-1)) + if (not removeFirstAndLast && (i == p.size()-2)) { - continue; + p.erase(p.begin() + i); + } + else + { + p.erase(p.begin() + i + 1); } - - p.erase(p.begin() + i + 1); --i; - continue; } } diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp index f131314d2..9c8890bf3 100644 --- a/src/libs/vlayout/vtextmanager.cpp +++ b/src/libs/vlayout/vtextmanager.cpp @@ -215,12 +215,34 @@ QMap PreparePlaceholders(const VAbstractPattern *doc, const VC placeholders.insert(pl_pFileName, QFileInfo(VAbstractValApplication::VApp()->GetPatternPath()).baseName()); placeholders.insert(pl_mFileName, QFileInfo(doc->MPath()).baseName()); - placeholders.insert(pl_height, QString::number(VAbstractValApplication::VApp()->GetDimensionHeight())); - placeholders.insert(pl_size, QString::number(VAbstractValApplication::VApp()->GetDimensionSize())); - placeholders.insert(pl_hip, QString::number(VAbstractValApplication::VApp()->GetDimensionHip())); - placeholders.insert(pl_waist, QString::number(VAbstractValApplication::VApp()->GetDimensionWaist())); + QString heightValue = QString::number(VAbstractValApplication::VApp()->GetDimensionHeight()); + placeholders.insert(pl_height, heightValue); + + QString sizeValue = QString::number(VAbstractValApplication::VApp()->GetDimensionSize()); + placeholders.insert(pl_size, sizeValue); + + QString hipValue = QString::number(VAbstractValApplication::VApp()->GetDimensionHip()); + placeholders.insert(pl_hip, hipValue); + + QString waistValue = QString::number(VAbstractValApplication::VApp()->GetDimensionWaist()); + placeholders.insert(pl_waist, waistValue); + + { + QString label = VAbstractValApplication::VApp()->GetDimensionHeightLabel(); + placeholders.insert(pl_heightLabel, not label.isEmpty() ? label : heightValue); + + label = VAbstractValApplication::VApp()->GetDimensionSizeLabel(); + placeholders.insert(pl_sizeLabel, not label.isEmpty() ? label : sizeValue); + + label = VAbstractValApplication::VApp()->GetDimensionHipLabel(); + placeholders.insert(pl_hipLabel, not label.isEmpty() ? label : hipValue); + + label = VAbstractValApplication::VApp()->GetDimensionWaistLabel(); + placeholders.insert(pl_waistLabel, not label.isEmpty() ? label : waistValue); + } + placeholders.insert(pl_mExt, VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Multisize - ? QString("vst") : QString("vit")); + ? QStringLiteral("vst") : QStringLiteral("vit")); const QMap materials = doc->GetPatternMaterials(); for (int i = 0; i < userMaterialPlaceholdersQuantity; ++i) @@ -241,7 +263,6 @@ QMap PreparePlaceholders(const VAbstractPattern *doc, const VC auto i = measurements.constBegin(); while (i != measurements.constEnd()) { - QString description = i.value()->GetGuiText().isEmpty() ? i.key() : i.value()->GetGuiText(); placeholders.insert(pl_measurement + i.key(), QString::number(*i.value()->GetValue())); ++i; } diff --git a/src/libs/vmisc/def.cpp b/src/libs/vmisc/def.cpp index 5ad4789a9..001d523d6 100644 --- a/src/libs/vmisc/def.cpp +++ b/src/libs/vmisc/def.cpp @@ -138,6 +138,10 @@ const QString pl_size = QStringLiteral("size"); const QString pl_height = QStringLiteral("height"); const QString pl_hip = QStringLiteral("hip"); const QString pl_waist = QStringLiteral("waist"); +const QString pl_sizeLabel = QStringLiteral("sizeLabel"); +const QString pl_heightLabel = QStringLiteral("heightLabel"); +const QString pl_hipLabel = QStringLiteral("hipLabel"); +const QString pl_waistLabel = QStringLiteral("waistLabel"); const QString pl_date = QStringLiteral("date"); const QString pl_time = QStringLiteral("time"); const QString pl_birthDate = QStringLiteral("birthDate"); diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 664d3f2c1..816379595 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -406,6 +406,10 @@ extern const QString pl_size; extern const QString pl_height; extern const QString pl_hip; extern const QString pl_waist; +extern const QString pl_sizeLabel; +extern const QString pl_heightLabel; +extern const QString pl_hipLabel; +extern const QString pl_waistLabel; extern const QString pl_date; extern const QString pl_time; extern const QString pl_birthDate; diff --git a/src/libs/vmisc/projectversion.cpp b/src/libs/vmisc/projectversion.cpp index 25a7053c5..7595071a6 100644 --- a/src/libs/vmisc/projectversion.cpp +++ b/src/libs/vmisc/projectversion.cpp @@ -42,7 +42,7 @@ extern const int MAJOR_VERSION = 0; extern const int MINOR_VERSION = 7; -extern const int DEBUG_VERSION = 44; +extern const int DEBUG_VERSION = 46; extern const QString APP_VERSION_STR(QStringLiteral("%1.%2.%3.%4").arg(MAJOR_VERSION).arg(MINOR_VERSION) .arg(DEBUG_VERSION).arg(LATEST_TAG_DISTANCE)); diff --git a/src/libs/vmisc/projectversion.h b/src/libs/vmisc/projectversion.h index 7dc1bab2e..be2f7a35c 100644 --- a/src/libs/vmisc/projectversion.h +++ b/src/libs/vmisc/projectversion.h @@ -49,8 +49,8 @@ extern const QString APP_VERSION_STR; // Change version number in projectversion.cpp too. // Synchronize valentina.nsi -#define VER_FILEVERSION 0,7,44 -#define VER_FILEVERSION_STR "0.7.44\0" +#define VER_FILEVERSION 0,7,46 +#define VER_FILEVERSION_STR "0.7.46\0" #define V_PRERELEASE // Mark prerelease builds diff --git a/src/libs/vmisc/vabstractvalapplication.h b/src/libs/vmisc/vabstractvalapplication.h index cf53f6853..51164967c 100644 --- a/src/libs/vmisc/vabstractvalapplication.h +++ b/src/libs/vmisc/vabstractvalapplication.h @@ -108,6 +108,18 @@ public: qreal GetDimensionWaist() const; void SetDimensionWaist(qreal dimensionWaist); + QString GetDimensionHeightLabel() const; + void SetDimensionHeightLabel(const QString &label); + + QString GetDimensionSizeLabel() const; + void SetDimensionSizeLabel(const QString &label); + + QString GetDimensionHipLabel() const; + void SetDimensionHipLabel(const QString &label); + + QString GetDimensionWaistLabel() const; + void SetDimensionWaistLabel(const QString &label); + virtual void OpenSettings() override; VValentinaSettings *ValentinaSettings(); @@ -132,6 +144,11 @@ protected: qreal m_dimensionHip{0}; qreal m_dimensionWaist{0}; + QString m_dimensionHeightLabel{}; + QString m_dimensionSizeLabel{}; + QString m_dimensionHipLabel{}; + QString m_dimensionWaistLabel{}; + Unit m_dimensionSizeUnits{Unit::Cm}; /** @@ -363,6 +380,54 @@ inline void VAbstractValApplication::SetDimensionWaist(qreal dimensionWaist) m_dimensionWaist = dimensionWaist; } +//--------------------------------------------------------------------------------------------------------------------- +inline QString VAbstractValApplication::GetDimensionHeightLabel() const +{ + return m_dimensionHeightLabel; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractValApplication::SetDimensionHeightLabel(const QString &label) +{ + m_dimensionHeightLabel = label; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline QString VAbstractValApplication::GetDimensionSizeLabel() const +{ + return m_dimensionSizeLabel; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractValApplication::SetDimensionSizeLabel(const QString &label) +{ + m_dimensionSizeLabel = label; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline QString VAbstractValApplication::GetDimensionHipLabel() const +{ + return m_dimensionHipLabel; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractValApplication::SetDimensionHipLabel(const QString &label) +{ + m_dimensionHipLabel = label; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline QString VAbstractValApplication::GetDimensionWaistLabel() const +{ + return m_dimensionWaistLabel; +} + +//--------------------------------------------------------------------------------------------------------------------- +inline void VAbstractValApplication::SetDimensionWaistLabel(const QString &label) +{ + m_dimensionWaistLabel = label; +} + //--------------------------------------------------------------------------------------------------------------------- inline QDate VAbstractValApplication::GetCustomerBirthDate() const { diff --git a/src/libs/vmisc/vvalentinasettings.cpp b/src/libs/vmisc/vvalentinasettings.cpp index 65f66f55f..afbad7a02 100644 --- a/src/libs/vmisc/vvalentinasettings.cpp +++ b/src/libs/vmisc/vvalentinasettings.cpp @@ -81,6 +81,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingMultiplier, (QLatin1String("layo Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTextAsPaths, (QLatin1String("layout/textAsPaths"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingNestingTime, (QLatin1String("layout/time"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingEfficiencyCoefficient, (QLatin1String("layout/efficiencyCoefficient"))) +Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutExportFormat, (QLatin1String("layout/exportFormat"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperHeight, (QLatin1String("tiledPDF/paperHeight"))) Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingTiledPDFPaperWidth, (QLatin1String("tiledPDF/paperWidth"))) @@ -640,3 +641,15 @@ void VValentinaSettings::SetToolPanelScaling(const bool &value) { setValue(*settingToolPanelScaling, value); } + +//--------------------------------------------------------------------------------------------------------------------- +auto VValentinaSettings::GetLayoutExportFormat() const -> qint8 +{ + return qvariant_cast(value(*settingLayoutExportFormat, 0)); +} + +//--------------------------------------------------------------------------------------------------------------------- +void VValentinaSettings::SetLayoutExportFormat(qint8 format) +{ + setValue(*settingLayoutExportFormat, format); +} diff --git a/src/libs/vmisc/vvalentinasettings.h b/src/libs/vmisc/vvalentinasettings.h index 60d49fa71..44c913feb 100644 --- a/src/libs/vmisc/vvalentinasettings.h +++ b/src/libs/vmisc/vvalentinasettings.h @@ -167,6 +167,9 @@ public: bool GetToolPanelScaling() const; void SetToolPanelScaling(const bool &value); + auto GetLayoutExportFormat() const -> qint8; + void SetLayoutExportFormat(qint8 format); + private: Q_DISABLE_COPY(VValentinaSettings) diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index cfdff0d03..4c2f4e30a 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -28,7 +28,7 @@ #include "vcontainer.h" -#include +#include #include #include #include diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index a10ebdcd1..4e814f445 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -56,6 +56,7 @@ #include "../vgeometry/vspline.h" #include "../vgeometry/vsplinepath.h" #include "../vlayout/vabstractpiece.h" +#include "../vlayout/vrawsapoint.h" #include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vpiece.h" #include "../vpatterndb/vpiecenode.h" @@ -68,7 +69,7 @@ AbstractTest::AbstractTest(QObject *parent) : } //--------------------------------------------------------------------------------------------------------------------- -void AbstractTest::VectorFromJson(const QString &json, QVector& vector) +void AbstractTest::VectorFromJson(const QString &json, QVector& vector) const { QByteArray saveData; PrepareDocument(json, saveData); @@ -102,7 +103,7 @@ void AbstractTest::VectorFromJson(const QString &json, QVector& vector) } //--------------------------------------------------------------------------------------------------------------------- -void AbstractTest::VectorFromJson(const QString &json, QVector &vector) +void AbstractTest::VectorFromJson(const QString &json, QVector &vector) const { QByteArray saveData; PrepareDocument(json, saveData); @@ -133,6 +134,38 @@ void AbstractTest::VectorFromJson(const QString &json, QVector &vector } } +//--------------------------------------------------------------------------------------------------------------------- +void AbstractTest::VectorFromJson(const QString &json, QVector &vector) const +{ + QByteArray saveData; + PrepareDocument(json, saveData); + QJsonDocument loadDoc(QJsonDocument::fromJson(saveData)); + + const QString vectorKey = QStringLiteral("vector"); + + QJsonObject vectorObject = loadDoc.object(); + TestRoot(vectorObject, vectorKey, json); + + QJsonArray vectorArray = vectorObject[vectorKey].toArray(); + for (int i = 0; i < vectorArray.size(); ++i) + { + QJsonObject pointObject = vectorArray[i].toObject(); + + QString type; + AbstractTest::ReadStringValue(pointObject, QStringLiteral("type"), type); + + if (type != QLatin1String("VRawSAPoint")) + { + const QString error = QStringLiteral("Invalid json file '%1'. Unexpected class '%2'.").arg(json, type); + QFAIL(qUtf8Printable(error)); + } + + VRawSAPoint point; + RawSAPointFromJson(pointObject, point); + vector.append(point); + } +} + //--------------------------------------------------------------------------------------------------------------------- void AbstractTest::PieceFromJson(const QString &json, VPiece &piece, QSharedPointer &data) { @@ -274,25 +307,22 @@ void AbstractTest::Comparison(const QVector &ekv, const QVector::value>::type*> void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue) + const QString &defaultValue) const { if (itemObject.contains(attribute)) { @@ -725,7 +755,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString //--------------------------------------------------------------------------------------------------------------------- template::value>::type*> void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue) + const QString &defaultValue) const { if (itemObject.contains(attribute)) { @@ -764,7 +794,7 @@ void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString //--------------------------------------------------------------------------------------------------------------------- template::value>::type*> void AbstractTest::ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue) + const QString &defaultValue) const { if (itemObject.contains(attribute)) { @@ -838,7 +868,7 @@ void AbstractTest::QLineFromJson(const QJsonObject &itemObject, QLineF &line) } //--------------------------------------------------------------------------------------------------------------------- -void AbstractTest::SAPointFromJson(const QJsonObject &itemObject, VSAPoint &point) +void AbstractTest::SAPointFromJson(const QJsonObject &itemObject, VSAPoint &point) const { qreal x = 0; AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("x"), x); @@ -862,6 +892,22 @@ void AbstractTest::SAPointFromJson(const QJsonObject &itemObject, VSAPoint &poin point.SetAngleType(angleType); } +//--------------------------------------------------------------------------------------------------------------------- +void AbstractTest::RawSAPointFromJson(const QJsonObject &itemObject, VRawSAPoint &point) const +{ + qreal x = 0; + AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("x"), x); + point.setX(x); + + qreal y = 0; + AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("y"), y); + point.setY(y); + + bool loopPoint; + AbstractTest::ReadBooleanValue(itemObject, QStringLiteral("loopPoint"), loopPoint, QStringLiteral("0")); + point.SetLoopPoint(loopPoint); +} + //--------------------------------------------------------------------------------------------------------------------- void AbstractTest::SplineFromJson(const QJsonObject &itemObject, QSharedPointer &data) { diff --git a/src/libs/vtest/abstracttest.h b/src/libs/vtest/abstracttest.h index cd7b4c2d9..c57bd142a 100644 --- a/src/libs/vtest/abstracttest.h +++ b/src/libs/vtest/abstracttest.h @@ -61,6 +61,7 @@ class VSplinePoint; class VPieceNode; enum class GOType : qint8; struct VPiecePassmarkData; +class VRawSAPoint; class AbstractTest : public QObject { @@ -68,8 +69,9 @@ class AbstractTest : public QObject public: explicit AbstractTest(QObject *parent = nullptr); - void VectorFromJson(const QString &json, QVector& vector); - void VectorFromJson(const QString &json, QVector& vector); + void VectorFromJson(const QString &json, QVector& vector) const; + void VectorFromJson(const QString &json, QVector& vector) const; + void VectorFromJson(const QString &json, QVector& vector) const; void PieceFromJson(const QString &json, VPiece &piece, QSharedPointer &data); @@ -78,7 +80,7 @@ public: protected: void Comparison(const QVector &ekv, const QVector &ekvOrig) const; - void Comparison(const QPointF &result, const QPointF &expected) const; + void Comparison(const QPointF &result, const QPointF &expected, qreal testAccuracy) const; void Comparison(const QVector &result, const QVector &expected) const; QString ValentinaPath() const; @@ -91,30 +93,31 @@ protected: bool CopyRecursively(const QString &srcFilePath, const QString &tgtFilePath) const; void PrepareDocument(const QString &json, QByteArray &data) const; - void TestRoot(const QJsonObject &root, const QString &attribute, const QString &file); + void TestRoot(const QJsonObject &root, const QString &attribute, const QString &file) const; template ::value>::type* = nullptr> void ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue = QString()); + const QString &defaultValue = QString()) const; template ::value>::type* = nullptr> void ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue = QString()); + const QString &defaultValue = QString()) const; template ::value>::type* = nullptr> void ReadDoubleValue(const QJsonObject &itemObject, const QString &attribute, T &value, - const QString &defaultValue = QString()); + const QString &defaultValue = QString()) const; void ReadStringValue(const QJsonObject &itemObject, const QString &attribute, QString &value, - const QString &defaultValue = QString()); + const QString &defaultValue = QString()) const; void ReadBooleanValue(const QJsonObject &itemObject, const QString &attribute, bool &value, - const QString &defaultValue = QString()); + const QString &defaultValue = QString()) const; void ReadPointValue(const QJsonObject &itemObject, const QString &attribute, VPointF &value); void ReadSplinePointValues(const QJsonObject &itemObject, const QString &attribute, QVector &points); void ReadSplinePointValue(const QJsonObject &itemObject, VSplinePoint &point); void ReadPieceNodeValue(const QJsonObject &itemObject, VPieceNode &node); - void QPointFromJson(const QJsonObject &itemObject, QPointF &point); + void QPointFromJson(const QJsonObject &itemObject, QPointF &point) const; void VPointFromJson(const QJsonObject &itemObject, VPointF &point); void QLineFromJson(const QJsonObject &itemObject, QLineF &line); - void SAPointFromJson(const QJsonObject &itemObject, VSAPoint &point); + void SAPointFromJson(const QJsonObject &itemObject, VSAPoint &point) const; + void RawSAPointFromJson(const QJsonObject &itemObject, VRawSAPoint &point) const; void SplineFromJson(const QJsonObject &itemObject, QSharedPointer &data); void SplinePathFromJson(const QJsonObject &itemObject, QSharedPointer &data); diff --git a/src/libs/vtools/dialogs/support/dialogeditlabel.cpp b/src/libs/vtools/dialogs/support/dialogeditlabel.cpp index ca0ae266a..49286f51d 100644 --- a/src/libs/vtools/dialogs/support/dialogeditlabel.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditlabel.cpp @@ -535,18 +535,41 @@ void DialogEditLabel::InitPlaceholders() const QString measurementsFilePath = QFileInfo(m_doc->MPath()).baseName(); m_placeholders.insert(pl_mFileName, qMakePair(tr("Measurments file name"), measurementsFilePath)); - m_placeholders.insert(pl_height, qMakePair(tr("Height", "dimension"), - QString::number(VAbstractValApplication::VApp()->GetDimensionHeight()))); - m_placeholders.insert(pl_size, qMakePair(tr("Size", "dimension"), - QString::number(VAbstractValApplication::VApp()->GetDimensionSize()))); - m_placeholders.insert(pl_hip, qMakePair(tr("Hip", "dimension"), - QString::number(VAbstractValApplication::VApp()->GetDimensionHip()))); - m_placeholders.insert(pl_waist, qMakePair(tr("Waist", "dimension"), - QString::number(VAbstractValApplication::VApp()->GetDimensionWaist()))); + QString heightValue = QString::number(VAbstractValApplication::VApp()->GetDimensionHeight()); + m_placeholders.insert(pl_height, qMakePair(tr("Height", "dimension"), heightValue)); + + QString sizeValue = QString::number(VAbstractValApplication::VApp()->GetDimensionSize()); + m_placeholders.insert(pl_size, qMakePair(tr("Size", "dimension"), sizeValue)); + + QString hipValue = QString::number(VAbstractValApplication::VApp()->GetDimensionHip()); + m_placeholders.insert(pl_hip, qMakePair(tr("Hip", "dimension"), hipValue)); + + QString waistValue = QString::number(VAbstractValApplication::VApp()->GetDimensionWaist()); + m_placeholders.insert(pl_waist, qMakePair(tr("Waist", "dimension"), waistValue)); + + { + QString label = VAbstractValApplication::VApp()->GetDimensionHeightLabel(); + m_placeholders.insert(pl_heightLabel, qMakePair(tr("Height label", "dimension"), + not label.isEmpty() ? label : heightValue)); + + label = VAbstractValApplication::VApp()->GetDimensionSizeLabel(); + m_placeholders.insert(pl_sizeLabel, qMakePair(tr("Size label", "dimension"), + not label.isEmpty() ? label : sizeValue)); + + label = VAbstractValApplication::VApp()->GetDimensionHipLabel(); + m_placeholders.insert(pl_hipLabel, qMakePair(tr("Hip label", "dimension"), + not label.isEmpty() ? label : hipValue)); + + label = VAbstractValApplication::VApp()->GetDimensionWaistLabel(); + m_placeholders.insert(pl_waistLabel, qMakePair(tr("Waist label", "dimension"), + not label.isEmpty() ? label : waistValue)); + } + + m_placeholders.insert(pl_mExt, qMakePair(tr("Measurments extension"), VAbstractValApplication::VApp()->GetMeasurementsType() == MeasurementsType::Multisize - ? QString("vst") : QString("vit"))); + ? QStringLiteral("vst") : QStringLiteral("vit"))); const QString materialDescription = tr("User material"); const QMap materials = m_doc->GetPatternMaterials(); diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index 564aa4e17..ac1fb1d3b 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -28,7 +28,7 @@ #include "dialogarc.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index 86f3b7010..1f95b1b01 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -28,7 +28,7 @@ #include "dialogarcwithlength.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp index db69a46d0..b27c703d0 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp @@ -28,7 +28,7 @@ #include "dialogellipticalarc.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp index 17ab3bd06..37f06b24e 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointfromcircleandtangent.cpp @@ -28,7 +28,7 @@ #include "dialogpointfromcircleandtangent.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp index 961d847da..a6f9b16a9 100644 --- a/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpointofintersectioncircles.cpp @@ -28,7 +28,7 @@ #include "dialogpointofintersectioncircles.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/dialogtool.cpp b/src/libs/vtools/dialogs/tools/dialogtool.cpp index 6b72a97b5..14dec01d0 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.cpp +++ b/src/libs/vtools/dialogs/tools/dialogtool.cpp @@ -28,7 +28,7 @@ #include "dialogtool.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index a5ce833f0..35c8be301 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -379,6 +379,7 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece) SetDLAngle(ppData.GetRotation()); const VPatternLabelData &patternInfo = piece.GetPatternInfo(); + uiTabLabels->groupBoxPatternLabel->setEnabled(not m_doc->GetPatternLabelTemplate().isEmpty()); uiTabLabels->groupBoxPatternLabel->setChecked(patternInfo.IsVisible()); ChangeCurrentData(uiTabLabels->comboBoxPLCenterPin, patternInfo.CenterPin()); ChangeCurrentData(uiTabLabels->comboBoxPLTopLeftPin, patternInfo.TopLeftPin()); @@ -3930,6 +3931,7 @@ void DialogSeamAllowance::EditPatternLabel() if (QDialog::Accepted == editor.exec()) { m_patternTemplateLines = editor.GetTemplate(); + uiTabLabels->groupBoxPatternLabel->setEnabled(not m_patternTemplateLines.isEmpty()); m_patternTemplateDataChanged = true; } } diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 151ed27fc..6ff388ebf 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -28,7 +28,7 @@ #include "vtoolflippingbyaxis.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index 8dadba3e1..576f78eca 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -28,7 +28,7 @@ #include "vtoolflippingbyline.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index 447d1bad7..624d91b57 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -28,7 +28,7 @@ #include "vtoolmove.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 2bef5b625..f45aad1cf 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -28,7 +28,7 @@ #include "vtoolrotation.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index 64ea6c4b1..b1260c3dc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -28,7 +28,7 @@ #include "vtoolcurveintersectaxis.h" -#include +#include #include #include #include @@ -150,7 +150,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis const qreal segLength = curve->GetLengthByPoint(fPoint); - VPointF *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); + auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); p->SetShowLabel(initData.showLabel); if (initData.typeCreation == Source::FromGui) @@ -160,14 +160,14 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis initData.data->getNextId(); initData.data->getNextId(); - InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); + VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); } else { initData.data->UpdateGObject(initData.id, p); initData.data->AddLine(initData.basePointId, initData.id); - InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); + VToolSinglePoint::InitSegments(curve->getType(), segLength, p, initData.curveId, initData.data); if (initData.parse != Document::FullParse) { @@ -178,7 +178,7 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(VToolCurveIntersectAxis if (initData.parse == Document::FullParse) { VAbstractTool::AddRecord(initData.id, Tool::CurveIntersectAxis, initData.doc); - VToolCurveIntersectAxis *point = new VToolCurveIntersectAxis(initData); + auto *point = new VToolCurveIntersectAxis(initData); initData.scene->addItem(point); InitToolConnections(initData.scene, point); VAbstractPattern::AddTool(initData.id, point); @@ -308,163 +308,3 @@ void VToolCurveIntersectAxis::SetVisualization() visual->RefreshGeometry(); } } - -//--------------------------------------------------------------------------------------------------------------------- -template -void VToolCurveIntersectAxis::InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId) -{ - QSharedPointer a1; - QSharedPointer a2; - - const QSharedPointer arc = data->GeometricObject(curveId); - Item arc1; - Item arc2; - - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - arc->CutArc(segLength, arc1, arc2); - } - else - { - arc->CutArc(0, arc1, arc2); - } - - // Arc highly depend on id. Need for creating the name. - arc1.setId(p->id() + 1); - arc2.setId(p->id() + 2); - - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - a1 = QSharedPointer(new Item(arc1)); - a2 = QSharedPointer(new Item(arc2)); - } - else - { - a1 = QSharedPointer(new Item()); - a2 = QSharedPointer(new Item()); - - // Take names for empty arcs from donors. - a1->setName(arc1.name()); - a2->setName(arc2.name()); - } - - data->AddArc(a1, arc1.id(), p->id()); - data->AddArc(a2, arc2.id(), p->id()); -} - -//--------------------------------------------------------------------------------------------------------------------- -QT_WARNING_PUSH -QT_WARNING_DISABLE_GCC("-Wswitch-default") -void VToolCurveIntersectAxis::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, - VContainer *data) -{ - switch(curveType) - { - case GOType::EllipticalArc: - InitArc(data, segLength, p, curveId); - break; - case GOType::Arc: - InitArc(data, segLength, p, curveId); - break; - case GOType::CubicBezier: - case GOType::Spline: - { - QSharedPointer spline1; - QSharedPointer spline2; - - const auto spl = data->GeometricObject(curveId); - QPointF spl1p2, spl1p3, spl2p2, spl2p3; - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - spl->CutSpline(segLength, spl1p2, spl1p3, spl2p2, spl2p3); - } - else - { - spl->CutSpline(0, spl1p2, spl1p3, spl2p2, spl2p3); - } - - VSpline *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p); - VSpline *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4()); - - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - spline1 = QSharedPointer(spl1); - spline2 = QSharedPointer(spl2); - } - else - { - spline1 = QSharedPointer(new VSpline()); - spline2 = QSharedPointer(new VSpline()); - - // Take names for empty splines from donors. - spline1->setName(spl1->name()); - spline2->setName(spl2->name()); - - delete spl1; - delete spl2; - } - - data->RegisterUniqueName(spline1); - data->AddSpline(spline1, NULL_ID, p->id()); - - data->RegisterUniqueName(spline2); - data->AddSpline(spline2, NULL_ID, p->id()); - break; - } - case GOType::CubicBezierPath: - case GOType::SplinePath: - { - QSharedPointer splP1; - QSharedPointer splP2; - - const auto splPath = data->GeometricObject(curveId); - VSplinePath *splPath1 = nullptr; - VSplinePath *splPath2 = nullptr; - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - VPointF *pC = VToolCutSplinePath::CutSplinePath(segLength, splPath, p->name(), &splPath1, &splPath2); - delete pC; - } - else - { - VPointF *pC = VToolCutSplinePath::CutSplinePath(0, splPath, p->name(), &splPath1, &splPath2); - delete pC; - } - - SCASSERT(splPath1 != nullptr) - SCASSERT(splPath2 != nullptr) - - if (not VFuzzyComparePossibleNulls(segLength, -1)) - { - splP1 = QSharedPointer(splPath1); - splP2 = QSharedPointer(splPath2); - } - else - { - splP1 = QSharedPointer(new VSplinePath()); - splP2 = QSharedPointer(new VSplinePath()); - - // Take names for empty spline paths from donors. - splP1->setName(splPath1->name()); - splP2->setName(splPath2->name()); - - delete splPath1; - delete splPath2; - } - - data->RegisterUniqueName(splP1); - data->AddSpline(splP1, NULL_ID, p->id()); - - data->RegisterUniqueName(splP2); - data->AddSpline(splP2, NULL_ID, p->id()); - break; - } - case GOType::Point: - case GOType::PlaceLabel: - case GOType::Unknown: - Q_UNREACHABLE(); - break; - } -} - -QT_WARNING_POP diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index 605f8fa7c..fa967e5e8 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -228,6 +228,11 @@ void VToolBasePoint::SetBasePointPos(const QPointF &pos) //--------------------------------------------------------------------------------------------------------------------- void VToolBasePoint::DeleteToolWithConfirm(bool ask) { + if (doc->CountPP() <= 1) + { + return; + } + qCDebug(vTool, "Deleting base point."); emit VAbstractValApplication::VApp()->getSceneView()->itemClicked(nullptr); if (ask) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 6378c4223..113c467b3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -119,9 +119,9 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(VToolPoin auto curve1 = initData.data->GeometricObject(initData.firstCurveId); auto curve2 = initData.data->GeometricObject(initData.secondCurveId); - QPointF point; + QPointF fPoint; const bool success = VToolPointOfIntersectionCurves::FindPoint(curve1->GetPoints(), curve2->GetPoints(), - initData.vCrossPoint, initData.hCrossPoint, &point); + initData.vCrossPoint, initData.hCrossPoint, &fPoint); if (not success) { @@ -131,16 +131,26 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(VToolPoin qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; } - VPointF *p = new VPointF(point, initData.name, initData.mx, initData.my); + const qreal segLength1 = curve1->GetLengthByPoint(fPoint); + const qreal segLength2 = curve2->GetLengthByPoint(fPoint); + + auto *p = new VPointF(fPoint, initData.name, initData.mx, initData.my); p->SetShowLabel(initData.showLabel); if (initData.typeCreation == Source::FromGui) { initData.id = initData.data->AddGObject(p); + + VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, initData.firstCurveId, initData.data); + VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, initData.secondCurveId, initData.data); } else { initData.data->UpdateGObject(initData.id, p); + + VToolSinglePoint::InitSegments(curve1->getType(), segLength1, p, initData.firstCurveId, initData.data); + VToolSinglePoint::InitSegments(curve2->getType(), segLength2, p, initData.secondCurveId, initData.data); + if (initData.parse != Document::FullParse) { initData.doc->UpdateToolData(initData.id, initData.data); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 547c392eb..96d2fbab9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -52,6 +52,12 @@ #include "../vmisc/diagnostic.h" #include "../vgeometry/vgobject.h" #include "../vgeometry/vpointf.h" +#include "../vgeometry/vabstractcubicbezierpath.h" +#include "../vgeometry/vabstractcubicbezier.h" +#include "../vgeometry/vspline.h" +#include "../vgeometry/vsplinepath.h" +#include "../vgeometry/vellipticalarc.h" +#include "../vgeometry/varc.h" #include "../vmisc/vabstractapplication.h" #include "../vpatterndb/vcontainer.h" #include "../vwidgets/vgraphicssimpletextitem.h" @@ -59,6 +65,7 @@ #include "../../../vabstracttool.h" #include "../../vdrawtool.h" #include "../vabstractpoint.h" +#include "toolcut/vtoolcutsplinepath.h" QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") @@ -384,3 +391,120 @@ void VToolSinglePoint::ToolSelectionType(const SelectionType &type) VAbstractTool::ToolSelectionType(type); m_namePoint->LabelSelectionType(type); } + +//--------------------------------------------------------------------------------------------------------------------- +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wswitch-default") +void VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, + VContainer *data) +{ + switch(curveType) + { + case GOType::EllipticalArc: + InitArc(data, segLength, p, curveId); + break; + case GOType::Arc: + InitArc(data, segLength, p, curveId); + break; + case GOType::CubicBezier: + case GOType::Spline: + { + QSharedPointer spline1; + QSharedPointer spline2; + + const auto spl = data->GeometricObject(curveId); + QPointF spl1p2, spl1p3, spl2p2, spl2p3; + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + spl->CutSpline(segLength, spl1p2, spl1p3, spl2p2, spl2p3); + } + else + { + spl->CutSpline(0, spl1p2, spl1p3, spl2p2, spl2p3); + } + + VSpline *spl1 = new VSpline(spl->GetP1(), spl1p2, spl1p3, *p); + VSpline *spl2 = new VSpline(*p, spl2p2, spl2p3, spl->GetP4()); + + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + spline1 = QSharedPointer(spl1); + spline2 = QSharedPointer(spl2); + } + else + { + spline1 = QSharedPointer(new VSpline()); + spline2 = QSharedPointer(new VSpline()); + + // Take names for empty splines from donors. + spline1->setName(spl1->name()); + spline2->setName(spl2->name()); + + delete spl1; + delete spl2; + } + + data->RegisterUniqueName(spline1); + data->AddSpline(spline1, NULL_ID, p->id()); + + data->RegisterUniqueName(spline2); + data->AddSpline(spline2, NULL_ID, p->id()); + break; + } + case GOType::CubicBezierPath: + case GOType::SplinePath: + { + QSharedPointer splP1; + QSharedPointer splP2; + + const auto splPath = data->GeometricObject(curveId); + VSplinePath *splPath1 = nullptr; + VSplinePath *splPath2 = nullptr; + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + VPointF *pC = VToolCutSplinePath::CutSplinePath(segLength, splPath, p->name(), &splPath1, &splPath2); + delete pC; + } + else + { + VPointF *pC = VToolCutSplinePath::CutSplinePath(0, splPath, p->name(), &splPath1, &splPath2); + delete pC; + } + + SCASSERT(splPath1 != nullptr) + SCASSERT(splPath2 != nullptr) + + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + splP1 = QSharedPointer(splPath1); + splP2 = QSharedPointer(splPath2); + } + else + { + splP1 = QSharedPointer(new VSplinePath()); + splP2 = QSharedPointer(new VSplinePath()); + + // Take names for empty spline paths from donors. + splP1->setName(splPath1->name()); + splP2->setName(splPath2->name()); + + delete splPath1; + delete splPath2; + } + + data->RegisterUniqueName(splP1); + data->AddSpline(splP1, NULL_ID, p->id()); + + data->RegisterUniqueName(splP2); + data->AddSpline(splP2, NULL_ID, p->id()); + break; + } + case GOType::Point: + case GOType::PlaceLabel: + case GOType::Unknown: + Q_UNREACHABLE(); + break; + } +} + +QT_WARNING_POP diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h index 926a0b20e..6fae77723 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.h @@ -106,8 +106,55 @@ protected: virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) override; virtual void SaveOptions(QDomElement &tag, QSharedPointer &obj) override; virtual void ChangeLabelVisibility(quint32 id, bool visible) override; + + template + static void InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId); + static void InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId, VContainer *data); private: Q_DISABLE_COPY(VToolSinglePoint) }; +//--------------------------------------------------------------------------------------------------------------------- +template +inline void VToolSinglePoint::InitArc(VContainer *data, qreal segLength, const VPointF *p, quint32 curveId) +{ + QSharedPointer a1; + QSharedPointer a2; + + const QSharedPointer arc = data->GeometricObject(curveId); + Item arc1; + Item arc2; + + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + arc->CutArc(segLength, arc1, arc2); + } + else + { + arc->CutArc(0, arc1, arc2); + } + + // Arc highly depend on id. Need for creating the name. + arc1.setId(p->id() + 1); + arc2.setId(p->id() + 2); + + if (not VFuzzyComparePossibleNulls(segLength, -1)) + { + a1 = QSharedPointer(new Item(arc1)); + a2 = QSharedPointer(new Item(arc2)); + } + else + { + a1 = QSharedPointer(new Item()); + a2 = QSharedPointer(new Item()); + + // Take names for empty arcs from donors. + a1->setName(arc1.name()); + a2->setName(arc2.name()); + } + + data->AddArc(a1, arc1.id(), p->id()); + data->AddArc(a2, arc2.id(), p->id()); +} + #endif // VTOOLSINGLEPOINT_H diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index a8e46b590..9bc5d8561 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -87,6 +87,57 @@ const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("top const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin"); const QString VToolSeamAllowance::AttrPiecePriority = QStringLiteral("priority"); +namespace +{ +//--------------------------------------------------------------------------------------------------------------------- +template +auto FixLabelPins(T itemData, const QMap &mappedPins) -> T +{ + itemData.SetCenterPin(mappedPins.value(itemData.CenterPin(), NULL_ID)); + itemData.SetTopLeftPin(mappedPins.value(itemData.TopLeftPin(), NULL_ID)); + itemData.SetBottomRightPin(mappedPins.value(itemData.BottomRightPin(), NULL_ID)); + return itemData; +} + +//--------------------------------------------------------------------------------------------------------------------- +template +auto FixGrainlinePins(T itemData, const QMap &mappedPins) -> T +{ + itemData.SetCenterPin(mappedPins.value(itemData.CenterPin(), NULL_ID)); + itemData.SetTopPin(mappedPins.value(itemData.TopPin(), NULL_ID)); + itemData.SetBottomPin(mappedPins.value(itemData.BottomPin(), NULL_ID)); + return itemData; +} + +//--------------------------------------------------------------------------------------------------------------------- +auto DuplicatePins(const QVector &pins, const VToolSeamAllowanceInitData &initData) -> QMap +{ + QMap newPins; + for(auto p : pins) + { + QSharedPointer pin = initData.data->GeometricObject(p); + + auto *tool = qobject_cast(VAbstractPattern::getTool(p)); + SCASSERT(tool != nullptr) + + VToolPinInitData initNodeData; + initNodeData.id = initData.data->AddGObject(new VPointF(*pin)); + initNodeData.pointId = pin->getIdObject(); + initNodeData.idObject = NULL_ID; // piece id + initNodeData.doc = initData.doc; + initNodeData.data = initData.data; + initNodeData.parse = Document::FullParse; + initNodeData.typeCreation = Source::FromTool; + initNodeData.drawName = initData.drawName; + initNodeData.idTool = tool->GetIdTool(); + + VToolPin::Create(initNodeData); + newPins.insert(p, initNodeData.id); + } + return newPins; +} +} // namespace + //--------------------------------------------------------------------------------------------------------------------- VToolSeamAllowance *VToolSeamAllowance::Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) @@ -193,7 +244,7 @@ VToolSeamAllowance *VToolSeamAllowance::Duplicate(const QPointer &di } //--------------------------------------------------------------------------------------------------------------------- -VToolSeamAllowance *VToolSeamAllowance::Duplicate(VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::Duplicate(VToolSeamAllowanceInitData &initData) -> VToolSeamAllowance * { VPiece dupDetail = initData.detail; @@ -202,10 +253,15 @@ VToolSeamAllowance *VToolSeamAllowance::Duplicate(VToolSeamAllowanceInitData &in dupDetail.SetCustomSARecords(DuplicateCustomSARecords(initData.detail.GetCustomSARecords(), initData, replacements)); dupDetail.SetInternalPaths(DuplicateInternalPaths(initData.detail.GetInternalPaths(), initData)); - dupDetail.SetPins(DuplicatePins(initData.detail.GetPins(), initData)); dupDetail.SetPlaceLabels(DuplicatePlaceLabels(initData.detail.GetPlaceLabels(), initData)); dupDetail.SetUUID(QUuid::createUuid()); + const QMap mappedPins = DuplicatePins(initData.detail.GetPins(), initData); + dupDetail.SetPins(mappedPins.values().toVector()); + dupDetail.SetPatternPieceData(FixLabelPins(initData.detail.GetPatternPieceData(), mappedPins)); + dupDetail.SetPatternInfo(FixLabelPins(initData.detail.GetPatternInfo(), mappedPins)); + dupDetail.SetGrainlineGeometry(FixGrainlinePins(initData.detail.GetGrainlineGeometry(), mappedPins)); + initData.detail = dupDetail; return VToolSeamAllowance::Create(initData); } @@ -879,14 +935,12 @@ void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem //--------------------------------------------------------------------------------------------------------------------- QRectF VToolSeamAllowance::boundingRect() const { - if (m_mainPathRect.isNull()) + if (m_pieceBoundingRect.isNull()) { return QGraphicsPathItem::boundingRect(); } - else - { - return m_mainPathRect; - } + + return m_pieceBoundingRect; } //--------------------------------------------------------------------------------------------------------------------- @@ -1217,7 +1271,6 @@ VToolSeamAllowance::VToolSeamAllowance(const VToolSeamAllowanceInitData &initDat : VInteractiveTool(initData.doc, initData.data, initData.id), QGraphicsPathItem(parent), m_mainPath(), - m_mainPathRect(), m_sceneDetails(initData.scene), m_drawName(initData.drawName), m_seamAllowance(new VNoBrushScalePathItem(this)), @@ -1313,7 +1366,6 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren) || not detail.IsSeamAllowance() || detail.IsSeamAllowanceBuiltIn()) { m_mainPath = QPainterPath(); - m_mainPathRect = QRectF(); m_seamAllowance->setBrush(QBrush(Qt::Dense7Pattern)); path = futurePath.result(); } @@ -1322,7 +1374,6 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren) m_seamAllowance->setBrush(QBrush(Qt::NoBrush)); // Disable if the main path was hidden // need for returning a bounding rect when main path is not visible m_mainPath = futurePath.result(); - m_mainPathRect = m_mainPath.controlPointRect(); path = QPainterPath(); } @@ -1342,10 +1393,14 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren) path.addPath(detail.SeamAllowancePath(futureSeamAllowance.result())); path.setFillRule(Qt::OddEvenFill); m_seamAllowance->setPath(path); + + m_pieceBoundingRect = m_seamAllowance->path().controlPointRect(); } else { m_seamAllowance->setPath(QPainterPath()); + + m_pieceBoundingRect = m_mainPath.controlPointRect(); } if (VAbstractApplication::VApp()->IsAppInGUIMode()) @@ -2111,36 +2166,6 @@ QVector VToolSeamAllowance::DuplicateInternalPaths(const QVector VToolSeamAllowance::DuplicatePins(const QVector &pins, - const VToolSeamAllowanceInitData &initData) -{ - QVector newPins; - newPins.reserve(pins.size()); - for(auto p : pins) - { - QSharedPointer pin = initData.data->GeometricObject(p); - - VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(p)); - SCASSERT(tool != nullptr) - - VToolPinInitData initNodeData; - initNodeData.id = initData.data->AddGObject(new VPointF(*pin)); - initNodeData.pointId = pin->getIdObject(); - initNodeData.idObject = NULL_ID; // piece id - initNodeData.doc = initData.doc; - initNodeData.data = initData.data; - initNodeData.parse = Document::FullParse; - initNodeData.typeCreation = Source::FromTool; - initNodeData.drawName = initData.drawName; - initNodeData.idTool = tool->GetIdTool(); - - VToolPin::Create(initNodeData); - newPins.append(initNodeData.id); - } - return newPins; -} - //--------------------------------------------------------------------------------------------------------------------- QVector VToolSeamAllowance::DuplicatePlaceLabels(const QVector &placeLabels, const VToolSeamAllowanceInitData &initData) diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index ce8c86963..4c0fd8219 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -66,7 +66,7 @@ public: static VToolSeamAllowance* Create(VToolSeamAllowanceInitData &initData); static VToolSeamAllowance* Duplicate(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc); - static VToolSeamAllowance* Duplicate(VToolSeamAllowanceInitData &initData); + static auto Duplicate(VToolSeamAllowanceInitData &initData) -> VToolSeamAllowance *; static const quint8 pieceVersion; @@ -176,7 +176,7 @@ private: Q_DISABLE_COPY(VToolSeamAllowance) QPainterPath m_mainPath; // Must be first to prevent crash - QRectF m_mainPathRect; + QRectF m_pieceBoundingRect{}; /** @brief sceneDetails pointer to the scene. */ VMainGraphicsScene *m_sceneDetails; @@ -194,7 +194,7 @@ private: /** @brief m_geometryIsReady is true when a piece's geometry is ready and checks for validity can be enabled. */ bool m_geometryIsReady{false}; - VToolSeamAllowance(const VToolSeamAllowanceInitData &initData, QGraphicsItem * parent = nullptr); + explicit VToolSeamAllowance(const VToolSeamAllowanceInitData &initData, QGraphicsItem * parent = nullptr); void UpdateExcludeState(); void UpdateInternalPaths(); @@ -233,7 +233,6 @@ private: static QVector DuplicateInternalPaths(const QVector &iPaths, const VToolSeamAllowanceInitData &initData); - static QVector DuplicatePins(const QVector &pins, const VToolSeamAllowanceInitData &initData); static QVector DuplicatePlaceLabels(const QVector &placeLabels, const VToolSeamAllowanceInitData &initData); }; diff --git a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp index 550a91c9c..0571b6e5c 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp @@ -28,7 +28,7 @@ #include "vistoolmove.h" -#include +#include #include #include #include diff --git a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp index 7a76e7e44..0321ec6e1 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp @@ -28,7 +28,7 @@ #include "vistoolrotation.h" -#include +#include #include #include #include diff --git a/src/test/ValentinaTest/share/Issue_548_case2/input.json b/src/test/ValentinaTest/share/Issue_548_case2/input.json new file mode 100644 index 000000000..3f07d5679 --- /dev/null +++ b/src/test/ValentinaTest/share/Issue_548_case2/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "type": "VSAPoint", + "x": 99.86433649395012, + "y": 10.166060970128015 + }, + { + "type": "VSAPoint", + "x": 236.976230899601, + "y": 65.89294600598842 + }, + { + "type": "VSAPoint", + "x": 198.9294347511521, + "y": 172.04822599160408 + }, + { + "type": "VSAPoint", + "x": 260.3187756756982, + "y": 75.38014122578073 + }, + { + "type": "VSAPoint", + "x": 324.5363299638826, + "y": 101.48031496062993 + }, + { + "type": "VSAPoint", + "x": 29.858267716535437, + "y": 300.8503937007874 + } + ] +} diff --git a/src/test/ValentinaTest/share/Issue_548_case2/output.json b/src/test/ValentinaTest/share/Issue_548_case2/output.json new file mode 100644 index 000000000..a5d109e59 --- /dev/null +++ b/src/test/ValentinaTest/share/Issue_548_case2/output.json @@ -0,0 +1,24 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": 73.4038432255171, + "y": -41.386063334917424 + }, + { + "type": "QPointF", + "x": 404.34279917400556, + "y": 93.11865802402654 + }, + { + "type": "QPointF", + "x": -29.71419544696289, + "y": 386.7882190877889 + }, + { + "type": "QPointF", + "x": 73.4038432255171, + "y": -41.386063334917424 + } + ] +} diff --git a/src/test/ValentinaTest/share/Issue_548_case3/input.json b/src/test/ValentinaTest/share/Issue_548_case3/input.json new file mode 100644 index 000000000..3f07d5679 --- /dev/null +++ b/src/test/ValentinaTest/share/Issue_548_case3/input.json @@ -0,0 +1,34 @@ +{ + "vector": [ + { + "type": "VSAPoint", + "x": 99.86433649395012, + "y": 10.166060970128015 + }, + { + "type": "VSAPoint", + "x": 236.976230899601, + "y": 65.89294600598842 + }, + { + "type": "VSAPoint", + "x": 198.9294347511521, + "y": 172.04822599160408 + }, + { + "type": "VSAPoint", + "x": 260.3187756756982, + "y": 75.38014122578073 + }, + { + "type": "VSAPoint", + "x": 324.5363299638826, + "y": 101.48031496062993 + }, + { + "type": "VSAPoint", + "x": 29.858267716535437, + "y": 300.8503937007874 + } + ] +} diff --git a/src/test/ValentinaTest/share/Issue_548_case3/output.json b/src/test/ValentinaTest/share/Issue_548_case3/output.json new file mode 100644 index 000000000..ae6a52336 --- /dev/null +++ b/src/test/ValentinaTest/share/Issue_548_case3/output.json @@ -0,0 +1,24 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": 46.94334995708405, + "y": -92.9381876399629 + }, + { + "type": "QPointF", + "x": 484.14926838412856, + "y": 84.75700108742315 + }, + { + "type": "QPointF", + "x": -89.28665861046107, + "y": 472.7260444747902 + }, + { + "type": "QPointF", + "x": 46.94334995708405, + "y": -92.9381876399629 + } + ] +} diff --git a/src/test/ValentinaTest/share/Issue_642/input.json b/src/test/ValentinaTest/share/Issue_642/input.json index a9e0f6599..7ddfd4a2a 100644 --- a/src/test/ValentinaTest/share/Issue_642/input.json +++ b/src/test/ValentinaTest/share/Issue_642/input.json @@ -202,58 +202,58 @@ }, { "type": "QPointF", - "x": 2795.1934418373985, - "y": 714.0407970608541 + "x": 2795.1870397580587, + "y": 714.0474084064654 }, { "type": "QPointF", - "x": 2797.520564686708, - "y": 711.5183868986292 + "x": 2797.5081938293038, + "y": 711.5320126236637 }, { "type": "QPointF", "x": 2797.55905511811, - "y": 711.5533198039858 + "y": 711.5781695971301 }, { "type": "QPointF", "x": 2797.55905511811, - "y": 711.5533198039858 + "y": 711.5781695971301 }, { "type": "QPointF", "x": 2797.565477459869, - "y": 778.3077483501366 + "y": 778.332404004272 }, { "type": "QPointF", "x": 2798.0441679430687, - "y": 888.600497760094 + "y": 888.6231149546354 }, { "type": "QPointF", "x": 2799.8047936736652, - "y": 981.4929110797046 + "y": 981.5120337720853 }, { "type": "QPointF", "x": 2803.650599415853, - "y": 1068.6060917850425 + "y": 1068.6208463497221 }, { "type": "QPointF", "x": 2810.3848299338274, - "y": 1161.5611433521817 + "y": 1161.5712385806464 }, { "type": "QPointF", "x": 2820.8107299917833, - "y": 1271.9791692571957 + "y": 1271.9848963579593 }, { "type": "QPointF", "x": 2844.4160857065513, - "y": 1489.955982223637 + "y": 1489.9567587796728 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_642/output.json b/src/test/ValentinaTest/share/Issue_642/output.json index 4f8a336c9..6506b435d 100644 --- a/src/test/ValentinaTest/share/Issue_642/output.json +++ b/src/test/ValentinaTest/share/Issue_642/output.json @@ -115,11 +115,6 @@ "x": 2651.457513977499, "y": 754.2498813699515 }, - { - "type": "QPointF", - "x": 2661.906602177309, - "y": 755.9323325983764 - }, { "type": "QPointF", "x": 2669.4674223109832, @@ -172,48 +167,43 @@ }, { "type": "QPointF", - "x": 2795.1934418373985, - "y": 714.0407970608541 - }, - { - "type": "QPointF", - "x": 2797.520564686708, - "y": 711.5183868986292 + "x": 2797.5081938293038, + "y": 711.5320126236637 }, { "type": "QPointF", "x": 2797.565477459869, - "y": 778.3077483501366 + "y": 778.332404004272 }, { "type": "QPointF", "x": 2798.0441679430687, - "y": 888.600497760094 + "y": 888.6231149546354 }, { "type": "QPointF", "x": 2799.8047936736652, - "y": 981.4929110797046 + "y": 981.5120337720853 }, { "type": "QPointF", "x": 2803.650599415853, - "y": 1068.6060917850425 + "y": 1068.6208463497221 }, { "type": "QPointF", "x": 2810.3848299338274, - "y": 1161.5611433521817 + "y": 1161.5712385806464 }, { "type": "QPointF", "x": 2820.8107299917833, - "y": 1271.9791692571957 + "y": 1271.9848963579593 }, { "type": "QPointF", "x": 2844.4160857065513, - "y": 1489.955982223637 + "y": 1489.9567587796728 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test1/output.json b/src/test/ValentinaTest/share/Issue_923_test1/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test1/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test1/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test1_1/output.json b/src/test/ValentinaTest/share/Issue_923_test1_1/output.json index 927e0b346..5d67403ad 100644 --- a/src/test/ValentinaTest/share/Issue_923_test1_1/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test1_1/output.json @@ -7,8 +7,8 @@ }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -48,17 +48,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -157,43 +157,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test2/output.json b/src/test/ValentinaTest/share/Issue_923_test2/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test2/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test2/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test2_2/input.json b/src/test/ValentinaTest/share/Issue_923_test2_2/input.json index 28ab6e9bb..3dedc917b 100644 --- a/src/test/ValentinaTest/share/Issue_923_test2_2/input.json +++ b/src/test/ValentinaTest/share/Issue_923_test2_2/input.json @@ -1,7 +1,7 @@ { "vector": [ { - "angle": 3, + "angle": 1, "saAfter": 151.18110236220474, "saBefore": 37.795275590551185, "type": "VSAPoint", @@ -468,7 +468,7 @@ "y": 331.90352529002166 }, { - "angle": 3, + "angle": 1, "saAfter": 151.18110236220474, "saBefore": 37.795275590551185, "type": "VSAPoint", diff --git a/src/test/ValentinaTest/share/Issue_923_test2_2/output.json b/src/test/ValentinaTest/share/Issue_923_test2_2/output.json index 55db89d3f..71edb7b5f 100644 --- a/src/test/ValentinaTest/share/Issue_923_test2_2/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test2_2/output.json @@ -2,13 +2,18 @@ "vector": [ { "type": "QPointF", - "x": -1086.319675233741, - "y": 603.286223243 + "x": -814.7149606299213, + "y": 372.2542552635805 }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -925.5802587835234, + "y": 240.26119236421624 + }, + { + "type": "QPointF", + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -48,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -157,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", @@ -222,13 +222,13 @@ }, { "type": "QPointF", - "x": -807.3585969245805, - "y": 374.1796788445591 + "x": -810.1810632465665, + "y": 373.5624561175904 }, { "type": "QPointF", - "x": -1086.319675233741, - "y": 603.286223243 + "x": -814.7149606299213, + "y": 372.2542552635805 } ] } diff --git a/src/test/ValentinaTest/share/Issue_923_test3/output.json b/src/test/ValentinaTest/share/Issue_923_test3/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test3/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test3/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test3_3/output.json b/src/test/ValentinaTest/share/Issue_923_test3_3/output.json index 5ccb7a046..9b6f4da36 100644 --- a/src/test/ValentinaTest/share/Issue_923_test3_3/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test3_3/output.json @@ -12,8 +12,8 @@ }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test4/output.json b/src/test/ValentinaTest/share/Issue_923_test4/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test4/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test4/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test4_4/output.json b/src/test/ValentinaTest/share/Issue_923_test4_4/output.json index 55db89d3f..6feafaec9 100644 --- a/src/test/ValentinaTest/share/Issue_923_test4_4/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test4_4/output.json @@ -7,8 +7,8 @@ }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -48,17 +48,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -157,43 +157,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test5/input.json b/src/test/ValentinaTest/share/Issue_923_test5/input.json index 91f787aba..70c4f82ae 100644 --- a/src/test/ValentinaTest/share/Issue_923_test5/input.json +++ b/src/test/ValentinaTest/share/Issue_923_test5/input.json @@ -1,7 +1,7 @@ { "vector": [ { - "angle": 5, + "angle": 4, "saAfter": 0, "saBefore": 37.795275590551185, "type": "VSAPoint", @@ -468,7 +468,7 @@ "y": 331.90352529002166 }, { - "angle": 5, + "angle": 4, "saAfter": 0, "saBefore": 37.795275590551185, "type": "VSAPoint", diff --git a/src/test/ValentinaTest/share/Issue_923_test5/output.json b/src/test/ValentinaTest/share/Issue_923_test5/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test5/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test5/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test5_5/input.json b/src/test/ValentinaTest/share/Issue_923_test5_5/input.json index a6670382c..f592c08f7 100644 --- a/src/test/ValentinaTest/share/Issue_923_test5_5/input.json +++ b/src/test/ValentinaTest/share/Issue_923_test5_5/input.json @@ -1,7 +1,7 @@ { "vector": [ { - "angle": 5, + "angle": 4, "saAfter": 151.18110236220474, "saBefore": 37.795275590551185, "type": "VSAPoint", @@ -468,7 +468,7 @@ "y": 331.90352529002166 }, { - "angle": 5, + "angle": 4, "saAfter": 151.18110236220474, "saBefore": 37.795275590551185, "type": "VSAPoint", diff --git a/src/test/ValentinaTest/share/Issue_923_test5_5/output.json b/src/test/ValentinaTest/share/Issue_923_test5_5/output.json index 914c5d73a..f6882ee98 100644 --- a/src/test/ValentinaTest/share/Issue_923_test5_5/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test5_5/output.json @@ -2,13 +2,18 @@ "vector": [ { "type": "QPointF", - "x": -831.5531621884526, - "y": 27.90388512315623 + "x": -949.5679059514944, + "y": 269.4686510059864 }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -925.5802587835218, + "y": 240.2611923642134 + }, + { + "type": "QPointF", + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -42,23 +47,23 @@ }, { "type": "QPointF", - "x": -631.8008980267215, - "y": -91.35633060009326 + "x": -631.5852394687809, + "y": -90.99511806183605 }, { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -157,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", @@ -227,18 +227,28 @@ }, { "type": "QPointF", - "x": -814.7149606299213, - "y": 372.2542552635805 + "x": -818.0929557813755, + "y": 371.2795759163598 }, { "type": "QPointF", - "x": -965.896062992126, - "y": 372.2542552635805 + "x": -823.6929755287612, + "y": 369.27180555079025 }, { "type": "QPointF", - "x": -831.5531621884526, - "y": 27.90388512315623 + "x": -829.5753368833404, + "y": 366.62694879394627 + }, + { + "type": "QPointF", + "x": -835.8151397150936, + "y": 362.8920896668543 + }, + { + "type": "QPointF", + "x": -949.5679059514944, + "y": 269.4686510059864 } ] } diff --git a/src/test/ValentinaTest/share/Issue_923_test6/output.json b/src/test/ValentinaTest/share/Issue_923_test6/output.json index b3c98f8f3..4ab19c564 100644 --- a/src/test/ValentinaTest/share/Issue_923_test6/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test6/output.json @@ -13,7 +13,7 @@ { "type": "QPointF", "x": -815.2818897637795, - "y": -46.697156391859295 + "y": -46.69715639185932 }, { "type": "QPointF", @@ -53,17 +53,17 @@ { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -162,43 +162,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test6_6/output.json b/src/test/ValentinaTest/share/Issue_923_test6_6/output.json index 914c5d73a..3f9e74ba8 100644 --- a/src/test/ValentinaTest/share/Issue_923_test6_6/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test6_6/output.json @@ -2,13 +2,13 @@ "vector": [ { "type": "QPointF", - "x": -831.5531621884526, - "y": 27.90388512315623 + "x": -831.5531621884527, + "y": 27.903885123156257 }, { "type": "QPointF", - "x": -797.7132813112016, - "y": -48.52244559084083 + "x": -797.7132813112017, + "y": -48.52244559084082 }, { "type": "QPointF", @@ -43,22 +43,22 @@ { "type": "QPointF", "x": -631.8008980267215, - "y": -91.35633060009326 + "y": -91.35633060009329 }, { "type": "QPointF", "x": -616.3280202339708, - "y": -100.59426715699185 + "y": -100.59426715699189 }, { "type": "QPointF", "x": -594.0963839106636, - "y": -115.97215530775165 + "y": -115.9721553077516 }, { "type": "QPointF", - "x": -184.04865014874554, - "y": 76.19837439910722 + "x": -184.04865014874542, + "y": 76.19837439910728 }, { "type": "QPointF", @@ -157,43 +157,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", @@ -237,8 +232,8 @@ }, { "type": "QPointF", - "x": -831.5531621884526, - "y": 27.90388512315623 + "x": -831.5531621884527, + "y": 27.903885123156257 } ] } diff --git a/src/test/ValentinaTest/share/Issue_923_test7_1/output.json b/src/test/ValentinaTest/share/Issue_923_test7_1/output.json index ed21365e3..a5ba6f90e 100644 --- a/src/test/ValentinaTest/share/Issue_923_test7_1/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test7_1/output.json @@ -107,43 +107,38 @@ }, { "type": "QPointF", - "x": -414.7876067251059, - "y": 388.13579550460213 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -721.6778577696439, - "y": 384.9687413227849 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test7_2/output.json b/src/test/ValentinaTest/share/Issue_923_test7_2/output.json index 986fd3723..9b5689717 100644 --- a/src/test/ValentinaTest/share/Issue_923_test7_2/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test7_2/output.json @@ -112,43 +112,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/Issue_923_test7_3/output.json b/src/test/ValentinaTest/share/Issue_923_test7_3/output.json index d36efbda0..171b3ead6 100644 --- a/src/test/ValentinaTest/share/Issue_923_test7_3/output.json +++ b/src/test/ValentinaTest/share/Issue_923_test7_3/output.json @@ -157,43 +157,38 @@ }, { "type": "QPointF", - "x": -415.23237001939634, - "y": 388.15813749078177 + "x": -435.9520270040894, + "y": 389.07661798449516 }, { "type": "QPointF", - "x": -457.7859582653625, - "y": 389.818484035946 + "x": -480.15529936788164, + "y": 390.3673559353522 }, { "type": "QPointF", - "x": -502.9230721502445, - "y": 390.728524359008 + "x": -525.9503830211974, + "y": 390.90684349642925 }, { "type": "QPointF", - "x": -549.0970864147907, - "y": 390.9068680348474 + "x": -572.2222728858704, + "y": 390.7329321107656 }, { "type": "QPointF", - "x": -595.1846601171007, - "y": 390.3891909827686 + "x": -617.8429427582322, + "y": 389.87963542037477 }, { "type": "QPointF", - "x": -640.0561486385066, - "y": 389.208081776043 + "x": -661.6840517509004, + "y": 388.3781346110808 }, { "type": "QPointF", - "x": -682.5877079123347, - "y": 387.3931112039713 - }, - { - "type": "QPointF", - "x": -722.1497906411519, - "y": 384.93382569436017 + "x": -702.630213618707, + "y": 386.255904969502 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/busty/output.json b/src/test/ValentinaTest/share/busty/output.json index 9d43df667..b566fceb6 100644 --- a/src/test/ValentinaTest/share/busty/output.json +++ b/src/test/ValentinaTest/share/busty/output.json @@ -78,12 +78,12 @@ { "type": "QPointF", "x": -1204.722502504057, - "y": -503.81468691330537 + "y": -503.81468691330525 }, { "type": "QPointF", "x": -1007.3842856723732, - "y": -576.996232950328 + "y": -576.9962329503279 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/smart_pattern_#112/input.json b/src/test/ValentinaTest/share/smart_pattern_#112/input.json new file mode 100644 index 000000000..c1d145d96 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#112/input.json @@ -0,0 +1,232 @@ +{ + "vector": [ + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3124.2446685548284, + "y": -340.15748031496076 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3111.699943251791, + "y": -396.7401714170824 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2725.3596865816003, + "y": -585.8267716535435 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2687.564410991049, + "y": -585.8267716535435 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2677.58560358191, + "y": -569.3428170188263 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2665.1502732124804, + "y": -552.0412529412208 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2654.7385639979766, + "y": -539.3532784199779 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2642.6534846020877, + "y": -526.5369475528651 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2629.0304140300964, + "y": -514.3953398593414 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2621.6288162143724, + "y": -508.90682548803926 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2617.633216578171, + "y": -506.2259849672243 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2607.5875815658464, + "y": -500.78291850199804 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2589.3518167947404, + "y": -492.6769341780546 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2562.160275286112, + "y": -482.74399225847844 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2536.9822947561124, + "y": -474.79665668016196 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2527.256410822591, + "y": -472.0553685667312 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2506.5962179242733, + "y": -340.15748031496076 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2515.110032578323, + "y": -335.7555078847252 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2535.9026816577343, + "y": -327.4893541781814 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2559.9139093453923, + "y": -319.92499126438355 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2585.699887733156, + "y": -313.12513181892416 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2624.7774917122233, + "y": -304.38080998706323 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2669.6720177906936, + "y": -296.12066401328417 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2698.5135894968607, + "y": -291.6966931721503 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2733.7651077284, + "y": -288.0502381685658 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2778.001039243382, + "y": -285.2249501336674 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2830.958905626066, + "y": -283.6151470999638 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2883.9661070936895, + "y": -283.5584406781999 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2901.245682896105, + "y": -284.5648866073816 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2928.8761792613104, + "y": -287.3856894036893 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2964.3753054127446, + "y": -292.55631940653257 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -2991.658167915314, + "y": -297.4313269801869 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3042.8109922236317, + "y": -308.3088184858541 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3067.2435220244433, + "y": -314.8760955596215 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3083.7898789348988, + "y": -320.39818087512595 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3100.269407664129, + "y": -327.1484210254447 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3116.4133322750586, + "y": -335.3579733766769 + }, + { + "loopPoint": false, + "type": "VRawSAPoint", + "x": -3124.2446685548284, + "y": -340.15748031496076 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#112/output.json b/src/test/ValentinaTest/share/smart_pattern_#112/output.json new file mode 100644 index 000000000..6950e917a --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#112/output.json @@ -0,0 +1,194 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": -3124.2446685548284, + "y": -340.15748031496076 + }, + { + "type": "QPointF", + "x": -3111.699943251791, + "y": -396.7401714170824 + }, + { + "type": "QPointF", + "x": -2725.3596865816003, + "y": -585.8267716535435 + }, + { + "type": "QPointF", + "x": -2687.564410991049, + "y": -585.8267716535435 + }, + { + "type": "QPointF", + "x": -2677.58560358191, + "y": -569.3428170188263 + }, + { + "type": "QPointF", + "x": -2665.1502732124804, + "y": -552.0412529412208 + }, + { + "type": "QPointF", + "x": -2654.7385639979766, + "y": -539.3532784199779 + }, + { + "type": "QPointF", + "x": -2642.6534846020877, + "y": -526.5369475528651 + }, + { + "type": "QPointF", + "x": -2629.0304140300964, + "y": -514.3953398593414 + }, + { + "type": "QPointF", + "x": -2621.6288162143724, + "y": -508.90682548803926 + }, + { + "type": "QPointF", + "x": -2617.633216578171, + "y": -506.2259849672243 + }, + { + "type": "QPointF", + "x": -2607.5875815658464, + "y": -500.78291850199804 + }, + { + "type": "QPointF", + "x": -2589.3518167947404, + "y": -492.6769341780546 + }, + { + "type": "QPointF", + "x": -2562.160275286112, + "y": -482.74399225847844 + }, + { + "type": "QPointF", + "x": -2536.9822947561124, + "y": -474.79665668016196 + }, + { + "type": "QPointF", + "x": -2527.256410822591, + "y": -472.0553685667312 + }, + { + "type": "QPointF", + "x": -2506.5962179242733, + "y": -340.15748031496076 + }, + { + "type": "QPointF", + "x": -2515.110032578323, + "y": -335.7555078847252 + }, + { + "type": "QPointF", + "x": -2535.9026816577343, + "y": -327.4893541781814 + }, + { + "type": "QPointF", + "x": -2559.9139093453923, + "y": -319.92499126438355 + }, + { + "type": "QPointF", + "x": -2585.699887733156, + "y": -313.12513181892416 + }, + { + "type": "QPointF", + "x": -2624.7774917122233, + "y": -304.38080998706323 + }, + { + "type": "QPointF", + "x": -2669.6720177906936, + "y": -296.12066401328417 + }, + { + "type": "QPointF", + "x": -2698.5135894968607, + "y": -291.6966931721503 + }, + { + "type": "QPointF", + "x": -2733.7651077284, + "y": -288.0502381685658 + }, + { + "type": "QPointF", + "x": -2778.001039243382, + "y": -285.2249501336674 + }, + { + "type": "QPointF", + "x": -2830.958905626066, + "y": -283.6151470999638 + }, + { + "type": "QPointF", + "x": -2883.9661070936895, + "y": -283.5584406781999 + }, + { + "type": "QPointF", + "x": -2901.245682896105, + "y": -284.5648866073816 + }, + { + "type": "QPointF", + "x": -2928.8761792613104, + "y": -287.3856894036893 + }, + { + "type": "QPointF", + "x": -2964.3753054127446, + "y": -292.55631940653257 + }, + { + "type": "QPointF", + "x": -2991.658167915314, + "y": -297.4313269801869 + }, + { + "type": "QPointF", + "x": -3042.8109922236317, + "y": -308.3088184858541 + }, + { + "type": "QPointF", + "x": -3067.2435220244433, + "y": -314.8760955596215 + }, + { + "type": "QPointF", + "x": -3083.7898789348988, + "y": -320.39818087512595 + }, + { + "type": "QPointF", + "x": -3100.269407664129, + "y": -327.1484210254447 + }, + { + "type": "QPointF", + "x": -3116.4133322750586, + "y": -335.3579733766769 + }, + { + "type": "QPointF", + "x": -3124.2446685548284, + "y": -340.15748031496076 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#113/input.json b/src/test/ValentinaTest/share/smart_pattern_#113/input.json new file mode 100644 index 000000000..820fd2e6b --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#113/input.json @@ -0,0 +1,391 @@ +{ + "vector": [ + { + "angle": 5, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2527.256410822591, + "y": -472.0553685667312 + }, + { + "angle": 5, + "saAfter": 26.45669291338583, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2506.5962179242733, + "y": -340.15748031496076 + }, + { + "angle": 5, + "saAfter": 26.45669291338583, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2506.5962179242733, + "y": -340.15748031496076 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2515.110032578323, + "y": -335.7555078847252 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2535.9026816577343, + "y": -327.4893541781814 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2559.9139093453923, + "y": -319.92499126438355 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2585.699887733156, + "y": -313.12513181892416 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2624.7774917122233, + "y": -304.38080998706323 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2669.6720177906936, + "y": -296.12066401328417 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2684.7297653217615, + "y": -293.714204315371 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2698.5135894968607, + "y": -291.6966931721503 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2733.7651077284, + "y": -288.0502381685658 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2778.001039243382, + "y": -285.2249501336674 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2830.958905626066, + "y": -283.6151470999638 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2860.9735489397144, + "y": -283.464566929134 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2860.9735489397144, + "y": -283.464566929134 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2868.5326040578248, + "y": -283.464566929134 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2876.091659175935, + "y": -283.464566929134 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2876.091659175935, + "y": -283.464566929134 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2883.9661070936895, + "y": -283.5584406781999 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2901.245682896105, + "y": -284.5648866073816 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2928.8761792613104, + "y": -287.3856894036893 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2964.3753054127446, + "y": -292.55631940653257 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2991.658167915314, + "y": -297.4313269801869 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -2999.2232819755905, + "y": -299.02542039719924 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3012.542620560272, + "y": -301.85968847054176 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3042.8109922236317, + "y": -308.3088184858541 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3067.2435220244433, + "y": -314.8760955596215 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3083.7898789348988, + "y": -320.39818087512595 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3100.269407664129, + "y": -327.1484210254447 + }, + { + "angle": 6, + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3116.4133322750586, + "y": -335.3579733766769 + }, + { + "angle": 4, + "saAfter": 37.795275590551185, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3124.2446685548284, + "y": -340.15748031496076 + }, + { + "angle": 4, + "saAfter": 37.795275590551185, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": -3124.2446685548284, + "y": -340.15748031496076 + }, + { + "angle": 4, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -3111.699943251791, + "y": -396.7401714170824 + }, + { + "type": "VSAPoint", + "x": -2725.3596865816003, + "y": -585.8267716535435 + }, + { + "saAfter": 37.795275590551185, + "type": "VSAPoint", + "x": -2687.564410991049, + "y": -585.8267716535435 + }, + { + "saAfter": 37.795275590551185, + "type": "VSAPoint", + "x": -2687.564410991049, + "y": -585.8267716535435 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2686.7442528592233, + "y": -584.3116737525777 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2677.58560358191, + "y": -569.3428170188263 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2665.1502732124804, + "y": -552.0412529412208 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2654.7385639979766, + "y": -539.3532784199779 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2642.6534846020877, + "y": -526.5369475528651 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2629.0304140300964, + "y": -514.3953398593414 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2621.6288162143724, + "y": -508.90682548803926 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2617.633216578171, + "y": -506.2259849672243 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2607.5875815658464, + "y": -500.78291850199804 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2589.3518167947404, + "y": -492.6769341780546 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2562.160275286112, + "y": -482.74399225847844 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2536.9822947561124, + "y": -474.79665668016196 + }, + { + "angle": 5, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": -2527.256410822591, + "y": -472.0553685667312 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#113/output.json b/src/test/ValentinaTest/share/smart_pattern_#113/output.json new file mode 100644 index 000000000..39c602f84 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#113/output.json @@ -0,0 +1,209 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": -2471.2062472153243, + "y": -358.4554679618417 + }, + { + "type": "QPointF", + "x": -2459.0551924596007, + "y": -334.95422398973403 + }, + { + "type": "QPointF", + "x": -2504.120784665144, + "y": -311.6535647080951 + }, + { + "type": "QPointF", + "x": -2527.0290640774483, + "y": -302.5463384931309 + }, + { + "type": "QPointF", + "x": -2553.167799186371, + "y": -294.3428373746984 + }, + { + "type": "QPointF", + "x": -2579.9225974675223, + "y": -287.3069305434689 + }, + { + "type": "QPointF", + "x": -2619.990081627151, + "y": -278.3608694684806 + }, + { + "type": "QPointF", + "x": -2665.4968144310456, + "y": -269.9954984287601 + }, + { + "type": "QPointF", + "x": -2695.791405702967, + "y": -265.3804184489778 + }, + { + "type": "QPointF", + "x": -2732.0787910936237, + "y": -261.6473418100125 + }, + { + "type": "QPointF", + "x": -2777.197185087822, + "y": -258.7804721011971 + }, + { + "type": "QPointF", + "x": -2830.9306026127674, + "y": -257.1584693256739 + }, + { + "type": "QPointF", + "x": -2885.504465434865, + "y": -257.1465105418511 + }, + { + "type": "QPointF", + "x": -2903.932685644061, + "y": -258.24499648326326 + }, + { + "type": "QPointF", + "x": -2932.689494194475, + "y": -261.20525340400195 + }, + { + "type": "QPointF", + "x": -2969.0289823829885, + "y": -266.51212829661677 + }, + { + "type": "QPointF", + "x": -2997.113235349967, + "y": -271.5431281398549 + }, + { + "type": "QPointF", + "x": -3049.6785855152784, + "y": -282.75900904833264 + }, + { + "type": "QPointF", + "x": -3075.618916688395, + "y": -289.7800926082317 + }, + { + "type": "QPointF", + "x": -3093.818214371114, + "y": -295.9157568061722 + }, + { + "type": "QPointF", + "x": -3111.298113285733, + "y": -303.07576225388163 + }, + { + "type": "QPointF", + "x": -3129.342114096473, + "y": -312.2515465102798 + }, + { + "type": "QPointF", + "x": -3172.1513358684783, + "y": -338.4875743830751 + }, + { + "type": "QPointF", + "x": -3158.32679295688, + "y": -361.0450257727725 + }, + { + "type": "QPointF", + "x": -3148.4422597423313, + "y": -405.6289824602926 + }, + { + "type": "QPointF", + "x": -3111.5429719361164, + "y": -397.44818687792895 + }, + { + "type": "QPointF", + "x": -2725.6089100584036, + "y": -586.3359831041486 + }, + { + "type": "QPointF", + "x": -2687.564410991049, + "y": -586.3937007874017 + }, + { + "type": "QPointF", + "x": -2654.3265534732623, + "y": -603.8192057466126 + }, + { + "type": "QPointF", + "x": -2646.077388368299, + "y": -590.2635801166397 + }, + { + "type": "QPointF", + "x": -2635.165693887321, + "y": -575.0818860522613 + }, + { + "type": "QPointF", + "x": -2626.3471284741554, + "y": -564.3353572190997 + }, + { + "type": "QPointF", + "x": -2616.2811919146543, + "y": -553.6603447340499 + }, + { + "type": "QPointF", + "x": -2605.152528643642, + "y": -543.7418859786677 + }, + { + "type": "QPointF", + "x": -2598.0578610376156, + "y": -538.6061651952249 + }, + { + "type": "QPointF", + "x": -2590.883226957164, + "y": -534.7187046100388 + }, + { + "type": "QPointF", + "x": -2575.1752701573723, + "y": -527.7363568347463 + }, + { + "type": "QPointF", + "x": -2549.9817887921495, + "y": -518.5332968657749 + }, + { + "type": "QPointF", + "x": -2533.733248010216, + "y": -513.4045056150975 + }, + { + "type": "QPointF", + "x": -2496.393272137569, + "y": -519.2533566814225 + }, + { + "type": "QPointF", + "x": -2471.2062472153243, + "y": -358.4554679618417 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#118/input.json b/src/test/ValentinaTest/share/smart_pattern_#118/input.json new file mode 100644 index 000000000..c5602fa22 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#118/input.json @@ -0,0 +1,251 @@ +{ + "vector": [ + { + "angle": 5, + "saAfter": 26.45669291338583, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1175.886910362366, + "y": 555.8793769255013 + }, + { + "saAfter": 26.45669291338583, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": 1210.4565869937005, + "y": 359.82499833625104 + }, + { + "angle": 4, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": 1245.0262636250343, + "y": 163.7706197470058 + }, + { + "angle": 4, + "saBefore": 26.45669291338583, + "type": "VSAPoint", + "x": 1245.0262636250343, + "y": 163.7706197470058 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1249.6525568482823, + "y": 164.14294264993185 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1328.6772421341088, + "y": 168.67117831036722 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1407.1175580331974, + "y": 171.5543246297218 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1483.528659051359, + "y": 172.90969229726562 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1556.465699694404, + "y": 172.85459200226887 + }, + { + "type": "VSAPoint", + "x": 1590.944877799307, + "y": 172.2833383788549 + }, + { + "type": "VSAPoint", + "x": 1590.944877799307, + "y": 172.2833383788549 + }, + { + "saAfter": 0, + "type": "VSAPoint", + "x": 1602.2834604764719, + "y": 172.28333858267717 + }, + { + "saBefore": 0, + "type": "VSAPoint", + "x": 1602.2834645669293, + "y": 871.4959370078741 + }, + { + "angle": 4, + "saAfter": 37.795275590551185, + "type": "VSAPoint", + "x": 1487.9905430001882, + "y": 871.4959370078741 + }, + { + "angle": 4, + "saAfter": 37.795275590551185, + "type": "VSAPoint", + "x": 1487.9905430001882, + "y": 871.4959370078741 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1485.3736111108465, + "y": 863.1390002359062 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1479.2436608108028, + "y": 846.6118709359941 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1472.1089977384408, + "y": 830.3196261529354 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1464.048056397443, + "y": 814.2742563578688 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1455.1392712914917, + "y": 798.4877520219336 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1445.461076924269, + "y": 782.9721036162691 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1429.744383860615, + "y": 760.1951110191317 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1406.7127536027315, + "y": 730.9328354430954 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1382.0153073660463, + "y": 702.9698120686455 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1356.2795211800185, + "y": 676.4019646648946 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1330.1328710741072, + "y": 651.3252170009557 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1317.1236562322474, + "y": 639.4441061406586 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1306.6722905128563, + "y": 630.2432611699617 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1284.4672776121818, + "y": 613.1923935152287 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1260.8445039829223, + "y": 597.6441315378071 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1235.9650552091725, + "y": 583.4669407191618 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1209.9900168750269, + "y": 570.5292865407575 + }, + { + "angle": 6, + "saAfter": 37.795275590551185, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1183.0804745645812, + "y": 558.6996344840597 + }, + { + "angle": 5, + "saAfter": 26.45669291338583, + "saBefore": 37.795275590551185, + "type": "VSAPoint", + "x": 1175.886910362366, + "y": 555.8793769255013 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#118/output.json b/src/test/ValentinaTest/share/smart_pattern_#118/output.json new file mode 100644 index 000000000..e604d4034 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#118/output.json @@ -0,0 +1,144 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": 1223.586134371358, + "y": 133.0056127624619 + }, + { + "type": "QPointF", + "x": 1249.640890671512, + "y": 137.59976927396653 + }, + { + "type": "QPointF", + "x": 1329.9200278416895, + "y": 142.2422996971724 + }, + { + "type": "QPointF", + "x": 1408.0893420196692, + "y": 145.11548509775966 + }, + { + "type": "QPointF", + "x": 1483.9978697539314, + "y": 146.45716044812525 + }, + { + "type": "QPointF", + "x": 1556.4457129886712, + "y": 146.3979066383616 + }, + { + "type": "QPointF", + "x": 1602.8503894555029, + "y": 145.81752096608884 + }, + { + "type": "QPointF", + "x": 1602.8503938555618, + "y": 897.9526299212599 + }, + { + "type": "QPointF", + "x": 1448.3854994804524, + "y": 897.9526299212599 + }, + { + "type": "QPointF", + "x": 1448.3854994804524, + "y": 872.0986142517511 + }, + { + "type": "QPointF", + "x": 1444.185885125444, + "y": 860.7759173198534 + }, + { + "type": "QPointF", + "x": 1437.8881811328367, + "y": 846.3948969439552 + }, + { + "type": "QPointF", + "x": 1430.6843973121577, + "y": 832.0557062171064 + }, + { + "type": "QPointF", + "x": 1422.631723280359, + "y": 817.7862438822315 + }, + { + "type": "QPointF", + "x": 1413.8560410480763, + "y": 803.7174625714251 + }, + { + "type": "QPointF", + "x": 1399.3105569558466, + "y": 782.6378129181111 + }, + { + "type": "QPointF", + "x": 1377.6756438965467, + "y": 755.1501022820776 + }, + { + "type": "QPointF", + "x": 1354.2630217275394, + "y": 728.6417866167658 + }, + { + "type": "QPointF", + "x": 1329.6163029711672, + "y": 703.198217176561 + }, + { + "type": "QPointF", + "x": 1304.3044047855055, + "y": 678.9220639742948 + }, + { + "type": "QPointF", + "x": 1282.6488410331592, + "y": 659.4487600742838 + }, + { + "type": "QPointF", + "x": 1262.5391808091847, + "y": 644.0068796036708 + }, + { + "type": "QPointF", + "x": 1241.078336069538, + "y": 629.8815765590062 + }, + { + "type": "QPointF", + "x": 1218.1697701289968, + "y": 616.8274645618288 + }, + { + "type": "QPointF", + "x": 1193.950386353718, + "y": 604.764267284976 + }, + { + "type": "QPointF", + "x": 1169.1867339246062, + "y": 593.8779657451806 + }, + { + "type": "QPointF", + "x": 1143.1319776244438, + "y": 589.2838092336752 + }, + { + "type": "QPointF", + "x": 1223.586134371358, + "y": 133.0056127624619 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/input.json b/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/input.json new file mode 100644 index 000000000..9bd2751c2 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/input.json @@ -0,0 +1,520 @@ +{ + "vector": [ + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + }, + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 726.8079975280607, + "y": 622.888701781939 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 754.3673278571332, + "y": 635.630828583758 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 781.0280722651629, + "y": 649.2144985332973 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 806.799580767585, + "y": 663.5877413692597 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 831.6912033798346, + "y": 678.6985868303482 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 855.7122901173473, + "y": 694.4950646552657 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 878.872190995558, + "y": 710.925204582715 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 901.180256029902, + "y": 727.9370363513991 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 922.6458352358145, + "y": 745.4785897000208 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 943.278278628731, + "y": 763.4978943672834 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 963.0869362240865, + "y": 781.9429800918895 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 982.0811580373162, + "y": 800.7618766125419 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1000.2702940838556, + "y": 819.9026136679438 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1017.6636943791395, + "y": 839.3132209967978 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1042.37878853631, + "y": 868.8039607286885 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1072.5033748045694, + "y": 908.6207538915453 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1099.6133183456423, + "y": 948.5815634448637 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1123.7834192830105, + "y": 988.2706272982668 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1145.088477740156, + "y": 1027.2721833613782 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1163.6032938405606, + "y": 1065.1704695438207 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1179.4026677077059, + "y": 1101.5497237552183 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1192.5613994650748, + "y": 1135.994183905194 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1203.154289236148, + "y": 1168.0880879033707 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1207.4096833403676, + "y": 1182.9997307219853 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1212.022828871306, + "y": 1200.3588500903552 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1219.4041899368062, + "y": 1235.235880725122 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1224.3720535154303, + "y": 1270.0050432406642 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1226.7046623947076, + "y": 1304.3347616404735 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1226.496853277681, + "y": 1329.562335863055 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1225.4788193061186, + "y": 1346.086759479433 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1223.6772332277046, + "y": 1362.3148105688415 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1221.0643753908807, + "y": 1378.2050421317176 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1217.612526144088, + "y": 1393.7160071684975 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1213.293965835767, + "y": 1408.8062586796173 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1208.0809748143597, + "y": 1423.4343496655133 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1201.945833428307, + "y": 1437.5588331266226 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1194.86082202605, + "y": 1451.1382620633813 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1186.79822095603, + "y": 1464.131189476226 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1177.7303105666883, + "y": 1476.4961683655927 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1167.6293712064657, + "y": 1488.1917517319184 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1156.4676832238038, + "y": 1499.1764925756397 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1144.2175269671434, + "y": 1509.408943897192 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1130.851182784926, + "y": 1518.847658697013 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1116.3409310255927, + "y": 1527.4511899755385 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1100.6590520375842, + "y": 1535.178090733205 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1083.7778261693425, + "y": 1541.986913970449 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1065.6695337693086, + "y": 1547.836212687707 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1046.3064551859234, + "y": 1552.6845398854152 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1025.660870767628, + "y": 1556.4904485640104 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1003.7050608628641, + "y": 1559.212491723929 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 980.4113058200722, + "y": 1560.8092223656067 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 955.751885987694, + "y": 1561.239193489481 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 942.8427542065093, + "y": 1560.9524866274971 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 932.8408996655451, + "y": 1560.5035571702351 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 913.8735721859588, + "y": 1558.1857240870427 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 896.1053882153979, + "y": 1554.2537835922294 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 879.4868872941008, + "y": 1548.8075818977768 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 863.9686089623065, + "y": 1541.9469652156642 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 849.5010927602539, + "y": 1533.7717797578728 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 836.0348782281815, + "y": 1524.3818717363822 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 823.5205049063281, + "y": 1513.8770873631734 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 811.9085123349323, + "y": 1502.3572728502265 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 801.149440054233, + "y": 1489.9222744095218 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 791.1938276044689, + "y": 1476.67193825304 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 781.9922145258788, + "y": 1462.706110592761 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 773.4951403587014, + "y": 1448.1246376406655 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 765.6531446431753, + "y": 1433.027365608734 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 754.9437999982238, + "y": 1409.6660208185863 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 742.5967537599449, + "y": 1377.57483681947 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 731.9797330525687, + "y": 1345.217688316655 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 718.3398397741655, + "y": 1297.7142208606672 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 706.5519873349563, + "y": 1254.5381527444517 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 698.8982319702905, + "y": 1229.1048431852737 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 690.9960837460767, + "y": 1207.3994176016122 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 684.6390350732308, + "y": 1194.2074612599308 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 680.1307128682538, + "y": 1186.8995080395903 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 1183.8169040655002 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 1183.8169040655002 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 1183.8169040655002 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 680.5249837176159, + "y": 1114.1626832930294 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 685.3436809655902, + "y": 1014.1063107551211 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 692.0193814449215, + "y": 900.1566306917512 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 700.1576970999383, + "y": 778.8334557524149 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 709.3642398749706, + "y": 656.6565985866073 + }, + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/output.json b/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/output.json new file mode 100644 index 000000000..456c459cf --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#120_piece_1/output.json @@ -0,0 +1,419 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": 679.3851616778779, + "y": 560.5071958351052 + }, + { + "type": "QPointF", + "x": 771.5253642394297, + "y": 601.9546553381315 + }, + { + "type": "QPointF", + "x": 799.4376087748578, + "y": 616.2058356936133 + }, + { + "type": "QPointF", + "x": 826.4126763608873, + "y": 631.2797030782433 + }, + { + "type": "QPointF", + "x": 852.4578079793142, + "y": 647.1196224652111 + }, + { + "type": "QPointF", + "x": 877.5809531604997, + "y": 663.6690296577056 + }, + { + "type": "QPointF", + "x": 901.7907248274646, + "y": 680.8715248752063 + }, + { + "type": "QPointF", + "x": 925.0963403503594, + "y": 698.6709507275484 + }, + { + "type": "QPointF", + "x": 947.5075534628146, + "y": 717.0114538453757 + }, + { + "type": "QPointF", + "x": 969.0345813622434, + "y": 735.8375305507107 + }, + { + "type": "QPointF", + "x": 989.6880307490753, + "y": 755.0940578223057 + }, + { + "type": "QPointF", + "x": 1009.4788258609301, + "y": 774.7263114219681 + }, + { + "type": "QPointF", + "x": 1028.4181408179645, + "y": 794.6799734175851 + }, + { + "type": "QPointF", + "x": 1046.6313379043359, + "y": 815.0365143510681 + }, + { + "type": "QPointF", + "x": 1072.5195471519162, + "y": 846.0000679241381 + }, + { + "type": "QPointF", + "x": 1103.2326972486792, + "y": 886.5947879276818 + }, + { + "type": "QPointF", + "x": 1131.8938186908024, + "y": 928.9231770809744 + }, + { + "type": "QPointF", + "x": 1156.952462519591, + "y": 970.1516475329622 + }, + { + "type": "QPointF", + "x": 1179.0478403597917, + "y": 1010.68168766554 + }, + { + "type": "QPointF", + "x": 1198.2703716433202, + "y": 1050.1146874790124 + }, + { + "type": "QPointF", + "x": 1214.7092455016766, + "y": 1088.0616393306495 + }, + { + "type": "QPointF", + "x": 1228.4522431131863, + "y": 1124.1480790942294 + }, + { + "type": "QPointF", + "x": 1239.498617577997, + "y": 1157.7163641148504 + }, + { + "type": "QPointF", + "x": 1243.9371430484484, + "y": 1173.292643401877 + }, + { + "type": "QPointF", + "x": 1248.798757776046, + "y": 1191.586744425441 + }, + { + "type": "QPointF", + "x": 1256.6412809572312, + "y": 1228.6427722795033 + }, + { + "type": "QPointF", + "x": 1261.9854393682826, + "y": 1266.0455530446939 + }, + { + "type": "QPointF", + "x": 1264.5105042440828, + "y": 1303.207705215837 + }, + { + "type": "QPointF", + "x": 1264.2825490193795, + "y": 1330.8809730344592 + }, + { + "type": "QPointF", + "x": 1263.0433176952379, + "y": 1350.2570493662236 + }, + { + "type": "QPointF", + "x": 1261.1324256351706, + "y": 1367.4696901324185 + }, + { + "type": "QPointF", + "x": 1258.1870795248535, + "y": 1385.3819665165963 + }, + { + "type": "QPointF", + "x": 1254.259895289484, + "y": 1403.028860402362 + }, + { + "type": "QPointF", + "x": 1249.2997133041586, + "y": 1420.3611166071119 + }, + { + "type": "QPointF", + "x": 1243.2551308267514, + "y": 1437.3227231182614 + }, + { + "type": "QPointF", + "x": 1236.076406635598, + "y": 1453.8497702928087 + }, + { + "type": "QPointF", + "x": 1227.7179800037757, + "y": 1469.869880074677 + }, + { + "type": "QPointF", + "x": 1218.1413963843438, + "y": 1485.3025989639923 + }, + { + "type": "QPointF", + "x": 1207.318198770456, + "y": 1500.0610829217153 + }, + { + "type": "QPointF", + "x": 1195.2321442955154, + "y": 1514.05517323754 + }, + { + "type": "QPointF", + "x": 1181.8800595132454, + "y": 1527.195586343914 + }, + { + "type": "QPointF", + "x": 1167.2708519352282, + "y": 1539.3985331681424 + }, + { + "type": "QPointF", + "x": 1151.4226411637437, + "y": 1550.5898312164527 + }, + { + "type": "QPointF", + "x": 1134.3585074135146, + "y": 1560.707630059371 + }, + { + "type": "QPointF", + "x": 1116.1017451381758, + "y": 1569.703247890992 + }, + { + "type": "QPointF", + "x": 1096.6715820282905, + "y": 1577.5401518645901 + }, + { + "type": "QPointF", + "x": 1076.0800742491963, + "y": 1584.191573068637 + }, + { + "type": "QPointF", + "x": 1054.3304683092908, + "y": 1589.63746358464 + }, + { + "type": "QPointF", + "x": 1031.4169229882777, + "y": 1593.861459342171 + }, + { + "type": "QPointF", + "x": 1007.3252389313808, + "y": 1596.8483044680145 + }, + { + "type": "QPointF", + "x": 982.0341722455236, + "y": 1598.5819459982806 + }, + { + "type": "QPointF", + "x": 954.9126743758827, + "y": 1599.02515094508 + }, + { + "type": "QPointF", + "x": 941.1480338176947, + "y": 1598.7097479128342 + }, + { + "type": "QPointF", + "x": 929.6966471777685, + "y": 1598.195756755684 + }, + { + "type": "QPointF", + "x": 907.483440354716, + "y": 1595.4812728246357 + }, + { + "type": "QPointF", + "x": 886.1127249748149, + "y": 1590.7521242889954 + }, + { + "type": "QPointF", + "x": 865.9269655274252, + "y": 1584.136863512658 + }, + { + "type": "QPointF", + "x": 846.989714534499, + "y": 1575.764722138622 + }, + { + "type": "QPointF", + "x": 829.3502587762655, + "y": 1565.797163078442 + }, + { + "type": "QPointF", + "x": 813.0301529589129, + "y": 1554.417254332673 + }, + { + "type": "QPointF", + "x": 798.0173460754563, + "y": 1541.8152410243486 + }, + { + "type": "QPointF", + "x": 784.2682736561633, + "y": 1528.175311182722 + }, + { + "type": "QPointF", + "x": 771.7152579891342, + "y": 1513.6669292169577 + }, + { + "type": "QPointF", + "x": 760.2756390298981, + "y": 1498.441467450863 + }, + { + "type": "QPointF", + "x": 749.8599308295067, + "y": 1482.6329364417857 + }, + { + "type": "QPointF", + "x": 739.954732735659, + "y": 1465.546575347063 + }, + { + "type": "QPointF", + "x": 731.2959376388606, + "y": 1448.777450809409 + }, + { + "type": "QPointF", + "x": 720.0938869758143, + "y": 1424.3413180139733 + }, + { + "type": "QPointF", + "x": 706.9812877693627, + "y": 1390.260386775834 + }, + { + "type": "QPointF", + "x": 695.6523318331946, + "y": 1355.64854530984 + }, + { + "type": "QPointF", + "x": 682.0124385547914, + "y": 1308.1450778538522 + }, + { + "type": "QPointF", + "x": 670.219541387873, + "y": 1264.96282546516 + }, + { + "type": "QPointF", + "x": 663.0158295671732, + "y": 1241.0250035749032 + }, + { + "type": "QPointF", + "x": 656.1276142232095, + "y": 1222.104623785708 + }, + { + "type": "QPointF", + "x": 651.4423683209832, + "y": 1212.3819423067657 + }, + { + "type": "QPointF", + "x": 648.9851082478891, + "y": 1208.3987439354166 + }, + { + "type": "QPointF", + "x": 639.4512595200423, + "y": 1196.0020170393075 + }, + { + "type": "QPointF", + "x": 642.759451136787, + "y": 1112.6635482583558 + }, + { + "type": "QPointF", + "x": 647.5921598654662, + "y": 1012.2882041596299 + }, + { + "type": "QPointF", + "x": 654.2887990813598, + "y": 897.946198274302 + }, + { + "type": "QPointF", + "x": 662.447168917079, + "y": 776.3038468625813 + }, + { + "type": "QPointF", + "x": 671.6758151491617, + "y": 653.8166164295044 + }, + { + "type": "QPointF", + "x": 679.3851616778779, + "y": 560.5071958351052 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/input.json b/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/input.json new file mode 100644 index 000000000..841716296 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/input.json @@ -0,0 +1,321 @@ +{ + "vector": [ + { + "angle": 4, + "type": "VSAPoint", + "x": 726.3328951195898, + "y": 466.32672911664105 + }, + { + "angle": 4, + "type": "VSAPoint", + "x": 726.3328951195898, + "y": 466.32672911664105 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 748.4704983324366, + "y": 467.6644498046602 + }, + { + "type": "VSAPoint", + "x": 893.3647248091735, + "y": 475.431155781443 + }, + { + "type": "VSAPoint", + "x": 893.3647248091735, + "y": 475.431155781443 + }, + { + "type": "VSAPoint", + "x": 893.3647248091735, + "y": 475.431155781443 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 900.7799673284717, + "y": 475.83396978129576 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1045.4320327261817, + "y": 482.7134397143277 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1214.0408472485012, + "y": 489.5927257320857 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1394.4761078914503, + "y": 495.3251575547605 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1529.9727237352329, + "y": 498.08351679152236 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1617.6880295809483, + "y": 499.01458866922655 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1701.5366515170822, + "y": 499.0139449657674 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1780.0023016681369, + "y": 497.9382518961688 + }, + { + "type": "VSAPoint", + "x": 1816.423613879903, + "y": 496.898717956112 + }, + { + "type": "VSAPoint", + "x": 1816.423613879903, + "y": 496.898717956112 + }, + { + "type": "VSAPoint", + "x": 1849.4135433070867, + "y": 1222.677165354331 + }, + { + "type": "VSAPoint", + "x": 1849.4135433070867, + "y": 1222.677165354331 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1850.4239458186876, + "y": 1238.2316356319525 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1854.1875736320867, + "y": 1268.5318954632107 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1859.7916578915156, + "y": 1297.6192626599368 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1866.9573864834126, + "y": 1325.22431970463 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1875.4059472942151, + "y": 1351.0776490797903 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1884.8585282103609, + "y": 1374.909833267917 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1895.0363171182871, + "y": 1396.45145475151 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1905.6605019044318, + "y": 1415.4330960130683 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1911.0540380375096, + "y": 1423.7562266489372 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1915.2176538409371, + "y": 1429.836295711893 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1924.2956860224986, + "y": 1441.6625061671757 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1934.1907119103657, + "y": 1453.0690095985565 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1944.80943485638, + "y": 1464.0347017625381 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1961.8290579118616, + "y": 1479.6722498340055 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 1986.2891263748718, + "y": 1498.7055156356078 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 2011.9646434036204, + "y": 1515.5956599846636 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 2038.1092358128394, + "y": 1530.173848933194 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 2063.9765304172624, + "y": 1542.2712485332213 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 2088.8201540316245, + "y": 1551.7190248367672 + }, + { + "angle": 5, + "type": "VSAPoint", + "x": 2100.5355463151377, + "y": 1555.2755905511813 + }, + { + "angle": 5, + "type": "VSAPoint", + "x": 2100.5355463151377, + "y": 1555.2755905511813 + }, + { + "type": "VSAPoint", + "x": 2100.5355463151377, + "y": 3063.3070866141734 + }, + { + "angle": 4, + "saAfter": 151.18110236220474, + "type": "VSAPoint", + "x": 2100.5355463151377, + "y": 4586.456692913386 + }, + { + "saBefore": 151.18110236220474, + "type": "VSAPoint", + "x": 677.76, + "y": 4586.456692913386 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 3063.3070866141734 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 1183.8169040655002 + }, + { + "type": "VSAPoint", + "x": 677.76, + "y": 1183.8169040655002 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 680.5249837176159, + "y": 1114.1626832930294 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 685.3436809655902, + "y": 1014.1063107551211 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 692.0193814449215, + "y": 900.1566306917512 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 700.1576970999383, + "y": 778.8334557524149 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 709.3642398749706, + "y": 656.6565985866073 + }, + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + }, + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + }, + { + "type": "VSAPoint", + "x": 712.6504153073016, + "y": 616.8877702072326 + }, + { + "angle": 6, + "type": "VSAPoint", + "x": 719.2446217143472, + "y": 540.1458718438239 + }, + { + "angle": 4, + "type": "VSAPoint", + "x": 726.3328951195898, + "y": 466.32672911664105 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/output.json b/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/output.json new file mode 100644 index 000000000..dbb6c7b63 --- /dev/null +++ b/src/test/ValentinaTest/share/smart_pattern_#120_piece_2/output.json @@ -0,0 +1,204 @@ +{ + "vector": [ + { + "type": "QPointF", + "x": 692.3263132377243, + "y": 425.0598484090772 + }, + { + "type": "QPointF", + "x": 729.9485435174106, + "y": 428.6724161589221 + }, + { + "type": "QPointF", + "x": 902.8367306099547, + "y": 438.0946986997068 + }, + { + "type": "QPointF", + "x": 1047.2274990256597, + "y": 444.9608350659975 + }, + { + "type": "QPointF", + "x": 1215.5816229877987, + "y": 451.8288691084969 + }, + { + "type": "QPointF", + "x": 1395.6762590253597, + "y": 457.54894156875224 + }, + { + "type": "QPointF", + "x": 1530.7419780161567, + "y": 460.29607039967215 + }, + { + "type": "QPointF", + "x": 1618.0891925886142, + "y": 461.22144213169855 + }, + { + "type": "QPointF", + "x": 1701.5363613638349, + "y": 461.2186693763291 + }, + { + "type": "QPointF", + "x": 1779.204057451268, + "y": 460.15036806979015 + }, + { + "type": "QPointF", + "x": 1852.4772835848457, + "y": 458.0590099929468 + }, + { + "type": "QPointF", + "x": 1888.112185721004, + "y": 1235.031600121014 + }, + { + "type": "QPointF", + "x": 1891.5390667367983, + "y": 1262.620774804999 + }, + { + "type": "QPointF", + "x": 1896.6767985033866, + "y": 1289.287591993124 + }, + { + "type": "QPointF", + "x": 1903.2463666212266, + "y": 1314.5960167159142 + }, + { + "type": "QPointF", + "x": 1910.9690199812524, + "y": 1338.228006286451 + }, + { + "type": "QPointF", + "x": 1919.546670079213, + "y": 1359.8542836861754 + }, + { + "type": "QPointF", + "x": 1928.6530532008871, + "y": 1379.1282399517556 + }, + { + "type": "QPointF", + "x": 1938.0436997249546, + "y": 1395.9059868680563 + }, + { + "type": "QPointF", + "x": 1945.822628290763, + "y": 1407.6356364111596 + }, + { + "type": "QPointF", + "x": 1953.5872392492531, + "y": 1417.7508157211655 + }, + { + "type": "QPointF", + "x": 1962.0622235753383, + "y": 1427.5203644714038 + }, + { + "type": "QPointF", + "x": 1971.193285152719, + "y": 1436.9497855888935 + }, + { + "type": "QPointF", + "x": 1986.4149731529892, + "y": 1450.5996057600491 + }, + { + "type": "QPointF", + "x": 2008.3149346481869, + "y": 1467.954893611232 + }, + { + "type": "QPointF", + "x": 2031.5799186205747, + "y": 1483.2593152177033 + }, + { + "type": "QPointF", + "x": 2055.3399893657565, + "y": 1496.5078981495822 + }, + { + "type": "QPointF", + "x": 2078.719642066318, + "y": 1507.441898227823 + }, + { + "type": "QPointF", + "x": 2100.6375771334715, + "y": 1515.7770650603459 + }, + { + "type": "QPointF", + "x": 2138.330821905689, + "y": 1515.7770650603459 + }, + { + "type": "QPointF", + "x": 2138.330821905689, + "y": 4737.637795275591 + }, + { + "type": "QPointF", + "x": 639.9647244094485, + "y": 4737.637795275591 + }, + { + "type": "QPointF", + "x": 639.9647244094488, + "y": 1183.067041495775 + }, + { + "type": "QPointF", + "x": 642.759451136787, + "y": 1112.6635482583558 + }, + { + "type": "QPointF", + "x": 647.5921598654662, + "y": 1012.2882041596299 + }, + { + "type": "QPointF", + "x": 654.2887990813598, + "y": 897.946198274302 + }, + { + "type": "QPointF", + "x": 662.447168917079, + "y": 776.3038468625813 + }, + { + "type": "QPointF", + "x": 671.6758151491617, + "y": 653.8166164295044 + }, + { + "type": "QPointF", + "x": 681.5845186532164, + "y": 536.9522071164919 + }, + { + "type": "QPointF", + "x": 692.3263132377243, + "y": 425.0598484090772 + } + ] +} diff --git a/src/test/ValentinaTest/share/smart_pattern_#36/input.json b/src/test/ValentinaTest/share/smart_pattern_#36/input.json index 6e2bee37f..539ab800f 100644 --- a/src/test/ValentinaTest/share/smart_pattern_#36/input.json +++ b/src/test/ValentinaTest/share/smart_pattern_#36/input.json @@ -6,12 +6,6 @@ "y": 21597.251791493014 }, { - "type": "VSAPoint", - "x": -188.23334010667102, - "y": 21597.251791493014 - }, - { - "angle": 6, "type": "VSAPoint", "x": -188.0288159203024, "y": 21597.69546369572 diff --git a/src/test/ValentinaTest/share/smart_pattern_#36/output.json b/src/test/ValentinaTest/share/smart_pattern_#36/output.json index c37c36ed6..73cd953c9 100644 --- a/src/test/ValentinaTest/share/smart_pattern_#36/output.json +++ b/src/test/ValentinaTest/share/smart_pattern_#36/output.json @@ -2,23 +2,8 @@ "vector": [ { "type": "QPointF", - "x": -215.6414755238939, - "y": 21610.019843083213 - }, - { - "type": "QPointF", - "x": -185.4416809267488, - "y": 21596.600628239823 - }, - { - "type": "QPointF", - "x": -215.87209587564425, - "y": 21609.478265010075 - }, - { - "type": "QPointF", - "x": -218.99406907567914, - "y": 21602.146768820647 + "x": -218.88332702810496, + "y": 21602.601187587297 }, { "type": "QPointF", @@ -130,11 +115,6 @@ "x": 44.74330398553326, "y": 21891.4437971853 }, - { - "type": "QPointF", - "x": 45.774998600307924, - "y": 21904.16054336412 - }, { "type": "QPointF", "x": 47.53333931071059, @@ -190,11 +170,6 @@ "x": 47.49610294540294, "y": 22693.52994907348 }, - { - "type": "QPointF", - "x": 45.806971514775746, - "y": 22718.852549989988 - }, { "type": "QPointF", "x": 44.62552984829121, @@ -332,8 +307,8 @@ }, { "type": "QPointF", - "x": -153.4650960199354, - "y": 22851.581055284918 + "x": -153.3907628043003, + "y": 22851.331837685506 }, { "type": "QPointF", @@ -382,7 +357,7 @@ }, { "type": "QPointF", - "x": -109.85897382113086, + "x": -109.85897382113089, "y": 22311.722834645672 }, { @@ -432,8 +407,8 @@ }, { "type": "QPointF", - "x": -153.4650960199354, - "y": 21771.864614006427 + "x": -153.53513142803976, + "y": 21771.61415466484 }, { "type": "QPointF", @@ -447,13 +422,13 @@ }, { "type": "QPointF", - "x": -202.58580499399324, - "y": 21638.045386629867 + "x": -202.6152214315237, + "y": 21637.97693416576 }, { "type": "QPointF", - "x": -215.6414755238939, - "y": 21610.019843083213 + "x": -218.88332702810496, + "y": 21602.601187587297 } ] } diff --git a/src/test/ValentinaTest/share/smart_pattern_#99/output.json b/src/test/ValentinaTest/share/smart_pattern_#99/output.json index e8a615d19..b6cd8bac8 100644 --- a/src/test/ValentinaTest/share/smart_pattern_#99/output.json +++ b/src/test/ValentinaTest/share/smart_pattern_#99/output.json @@ -7,38 +7,38 @@ }, { "type": "QPointF", - "x": 165.64275495245442, - "y": 301.03538140265255 + "x": 165.64505339863834, + "y": 297.1143398796336 }, { "type": "QPointF", - "x": 165.9241818618377, - "y": 283.76299680393265 + "x": 166.1722452473025, + "y": 280.2244654294098 }, { "type": "QPointF", - "x": 165.88627642302018, - "y": 280.21495093296807 + "x": 166.16205798196063, + "y": 276.72549910116425 }, { "type": "QPointF", - "x": 167.78024031224584, - "y": 263.63026674491516 + "x": 168.97844031610092, + "y": 256.82932371757767 }, { "type": "QPointF", - "x": 171.2459135294844, - "y": 247.0901582437869 + "x": 173.11677764302698, + "y": 240.88394423619718 }, { "type": "QPointF", - "x": 175.35351394576222, - "y": 234.8597797393187 + "x": 178.0948003175508, + "y": 228.9419652712462 }, { "type": "QPointF", - "x": 179.7306152508974, - "y": 225.99041905785725 + "x": 181.60851258888675, + "y": 223.02525030282638 }, { "type": "QPointF", @@ -47,8 +47,8 @@ }, { "type": "QPointF", - "x": 186.06814702527078, - "y": 217.44230267355644 + "x": 185.99757111618186, + "y": 217.49928602474253 }, { "type": "QPointF", @@ -62,38 +62,38 @@ }, { "type": "QPointF", - "x": 203.29392527811845, - "y": 204.51550744665195 + "x": 206.91766056957408, + "y": 202.6653456860961 }, { "type": "QPointF", - "x": 210.60586727103993, - "y": 200.97193709900534 + "x": 218.16643746973782, + "y": 198.0034374929712 }, { "type": "QPointF", - "x": 222.03055445161348, - "y": 196.7139895702384 + "x": 229.8999689979584, + "y": 194.5122323575353 }, { "type": "QPointF", - "x": 233.89457456941724, - "y": 193.60179993286891 + "x": 241.98385054517243, + "y": 192.18126436552825 }, { "type": "QPointF", - "x": 248.98872642851768, - "y": 191.42493440584562 + "x": 255.24575032218632, + "y": 191.05145610681262 }, { "type": "QPointF", - "x": 264.23377987042534, - "y": 190.90851689495304 + "x": 277.95765129804875, + "y": 191.65321329780488 }, { "type": "QPointF", - "x": 282.88849327137484, - "y": 192.3327170360014 + "x": 285.5408358146581, + "y": 192.855354584027 }, { "type": "QPointF", @@ -102,23 +102,18 @@ }, { "type": "QPointF", - "x": 292.0507070275667, - "y": 194.88291402164677 + "x": 297.61571920551216, + "y": 197.69023243490062 }, { "type": "QPointF", - "x": 302.2609179912159, - "y": 200.52339431871832 + "x": 308.61498933509586, + "y": 205.17662895779023 }, { "type": "QPointF", - "x": 312.4716122896351, - "y": 208.47683247462922 - }, - { - "type": "QPointF", - "x": 320.37180984256605, - "y": 216.47325684819089 + "x": 317.8211186961886, + "y": 213.7039790657329 }, { "type": "QPointF", @@ -127,13 +122,8 @@ }, { "type": "QPointF", - "x": 333.7748575886651, - "y": 234.23056124764497 - }, - { - "type": "QPointF", - "x": 340.96073277166533, - "y": 245.8168833793835 + "x": 335.7687333062743, + "y": 237.32368245582865 }, { "type": "QPointF", @@ -165,11 +155,6 @@ "x": 359.73199799735687, "y": 195.76084622496757 }, - { - "type": "QPointF", - "x": 362.7120659075751, - "y": 189.21200989719003 - }, { "type": "QPointF", "x": 364.2921931987103, @@ -182,13 +167,8 @@ }, { "type": "QPointF", - "x": 369.982180722541, - "y": 179.37377930160977 - }, - { - "type": "QPointF", - "x": 374.6890134539639, - "y": 175.54739778670276 + "x": 371.3330132939416, + "y": 177.8252966333725 }, { "type": "QPointF", @@ -197,8 +177,8 @@ }, { "type": "QPointF", - "x": 398.9256180190481, - "y": 162.99327226113368 + "x": 401.24232600874655, + "y": 162.09376642883635 }, { "type": "QPointF", @@ -207,18 +187,23 @@ }, { "type": "QPointF", - "x": 427.8889886897312, - "y": 154.18647318396557 + "x": 421.8791603554242, + "y": 155.51865193116913 }, { "type": "QPointF", - "x": 438.0633612753594, - "y": 153.03192944510397 + "x": 419.8611668067176, + "y": 155.48279077619534 }, { "type": "QPointF", - "x": 451.7825414078947, - "y": 152.8956366849569 + "x": 434.6801823142321, + "y": 153.28952836821526 + }, + { + "type": "QPointF", + "x": 448.33671251987124, + "y": 152.809882511774 }, { "type": "QPointF", @@ -237,8 +222,8 @@ }, { "type": "QPointF", - "x": 493.8490103693721, - "y": 164.62147416122724 + "x": 495.6447785087039, + "y": 165.95919540294628 }, { "type": "QPointF", @@ -247,13 +232,13 @@ }, { "type": "QPointF", - "x": 510.67904759033263, - "y": 180.57012994104807 + "x": 514.3692225121746, + "y": 184.8069411568055 }, { "type": "QPointF", - "x": 524.0023556963948, - "y": 196.43641192353618 + "x": 529.6792386289801, + "y": 203.52841021677506 }, { "type": "QPointF", @@ -267,8 +252,8 @@ }, { "type": "QPointF", - "x": 578.0175928754072, - "y": 272.3226478275148 + "x": 577.7959232247036, + "y": 271.8945967422089 }, { "type": "QPointF", @@ -302,8 +287,8 @@ }, { "type": "QPointF", - "x": 582.7107603326205, - "y": 369.9049033568516 + "x": 582.8754009676815, + "y": 369.4196601831339 }, { "type": "QPointF", @@ -352,8 +337,8 @@ }, { "type": "QPointF", - "x": 479.769261267493, - "y": 501.2042372736896 + "x": 476.32590489565666, + "y": 501.8211255823292 }, { "type": "QPointF", @@ -397,18 +382,18 @@ }, { "type": "QPointF", - "x": 390.1544796169675, - "y": 477.9820353387566 + "x": 389.46280257533397, + "y": 476.7991800818359 }, { "type": "QPointF", - "x": 386.5194680676028, - "y": 470.8821137717501 + "x": 385.21740968628404, + "y": 467.7455266773488 }, { "type": "QPointF", - "x": 381.8262598501652, - "y": 458.03556842219757 + "x": 381.98288724618385, + "y": 458.53069141599417 }, { "type": "QPointF", @@ -432,18 +417,13 @@ }, { "type": "QPointF", - "x": 341.93489933666746, - "y": 469.79816790408853 + "x": 340.52244605437, + "y": 471.85996007627705 }, { "type": "QPointF", - "x": 334.11338915152845, - "y": 479.95250344559355 - }, - { - "type": "QPointF", - "x": 325.34007746842036, - "y": 488.3512524365335 + "x": 332.3013407792153, + "y": 481.91406607342856 }, { "type": "QPointF", @@ -482,8 +462,8 @@ }, { "type": "QPointF", - "x": 232.08334886242122, - "y": 498.82957588934755 + "x": 228.17162935681384, + "y": 497.48744007705824 }, { "type": "QPointF", @@ -497,38 +477,33 @@ }, { "type": "QPointF", - "x": 200.54353768038376, - "y": 476.1142489208116 + "x": 199.2867956563084, + "y": 474.27137643587264 }, { "type": "QPointF", - "x": 194.51735337202624, - "y": 466.1928074212942 + "x": 193.05436777423637, + "y": 463.35364232842176 }, { "type": "QPointF", - "x": 188.96153147430664, - "y": 454.3702537301474 + "x": 186.4552262793201, + "y": 447.9927324953534 }, { "type": "QPointF", - "x": 183.01824799966036, - "y": 437.8681242930998 + "x": 181.07652203439048, + "y": 431.23130737455057 }, { "type": "QPointF", - "x": 179.18342598456445, - "y": 423.87894050611567 + "x": 176.74074040059125, + "y": 412.44411172139985 }, { "type": "QPointF", - "x": 175.960729453766, - "y": 408.06485844817104 - }, - { - "type": "QPointF", - "x": 173.8253139307419, - "y": 392.00129957222134 + "x": 174.31642834550638, + "y": 396.57264472089304 }, { "type": "QPointF", diff --git a/src/test/ValentinaTest/share/test_data.qrc b/src/test/ValentinaTest/share/test_data.qrc index e92c2a531..b0e383255 100644 --- a/src/test/ValentinaTest/share/test_data.qrc +++ b/src/test/ValentinaTest/share/test_data.qrc @@ -129,5 +129,19 @@ panties_case2/output.json smart_pattern_#99/input.json smart_pattern_#99/output.json + Issue_548_case2/input.json + Issue_548_case2/output.json + Issue_548_case3/input.json + Issue_548_case3/output.json + smart_pattern_#112/input.json + smart_pattern_#112/output.json + smart_pattern_#113/input.json + smart_pattern_#113/output.json + smart_pattern_#118/input.json + smart_pattern_#118/output.json + smart_pattern_#120_piece_1/input.json + smart_pattern_#120_piece_1/output.json + smart_pattern_#120_piece_2/input.json + smart_pattern_#120_piece_2/output.json diff --git a/src/test/ValentinaTest/tst_findpoint.cpp b/src/test/ValentinaTest/tst_findpoint.cpp index 9847bf3fb..86982d028 100644 --- a/src/test/ValentinaTest/tst_findpoint.cpp +++ b/src/test/ValentinaTest/tst_findpoint.cpp @@ -170,7 +170,7 @@ void TST_FindPoint::TestPointOfIntersectionCurves() static_cast(vCross), static_cast(hCross), &result); - Comparison(result, expect); + Comparison(result, expect, accuracyPointOnLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -211,8 +211,8 @@ void TST_FindPoint::TestTrueDarts() VToolTrueDarts::FindPoint(baseLineP1, baseLineP2, dartP1, dartP2, dartP3, p1, p2); - Comparison(p1, expectP1); - Comparison(p2, expectP2); + Comparison(p1, expectP1, accuracyPointOnLine); + Comparison(p2, expectP2, accuracyPointOnLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -239,7 +239,7 @@ void TST_FindPoint::TestLineIntersectAxis() QPointF resultPoint; VToolLineIntersectAxis::FindPoint(axis, line, &resultPoint); - Comparison(resultPoint, point); + Comparison(resultPoint, point, accuracyPointOnLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -272,7 +272,7 @@ void TST_FindPoint::TestTriangle() QPointF resultPoint; VToolTriangle::FindPoint(axisP1, axisP2, firstPoint, secondPoint, &resultPoint); - Comparison(point, resultPoint); + Comparison(point, resultPoint, accuracyPointOnLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -312,7 +312,7 @@ void TST_FindPoint::TestShoulderPoint() QPointF resultPoint = VToolShoulderPoint::FindPoint(p1, p2, pShoulder, length); - Comparison(point, resultPoint); + Comparison(point, resultPoint, accuracyPointOnLine); } //--------------------------------------------------------------------------------------------------------------------- @@ -745,5 +745,5 @@ void TST_FindPoint::TestCurveIntersectAxis() QPointF resultPoint; VToolCurveIntersectAxis::FindPoint(basePoint, angle, curvePoints, &resultPoint); - Comparison(resultPoint, result); + Comparison(resultPoint, result, accuracyPointOnLine); } diff --git a/src/test/ValentinaTest/tst_vabstractpiece.cpp b/src/test/ValentinaTest/tst_vabstractpiece.cpp index 004b50d1c..4a28780eb 100644 --- a/src/test/ValentinaTest/tst_vabstractpiece.cpp +++ b/src/test/ValentinaTest/tst_vabstractpiece.cpp @@ -28,6 +28,7 @@ #include "tst_vabstractpiece.h" #include "../vlayout/vabstractpiece.h" +#include "../vlayout/vrawsapoint.h" #include #include @@ -116,12 +117,10 @@ void TST_VAbstractPiece::EquidistantRemoveLoop_data() // https://bitbucket.org/dismine/valentina/issue/298/segmented-curve-isnt-selected-in-seam // See file src/app/share/collection/TestPuzzle.val // Code should clean loops in path. -#if !defined(Q_PROCESSOR_S390) && !defined(Q_PROCESSOR_S390_X) ASSERT_TEST_CASE("Issue 298. Case1", QStringLiteral("://Issue_298_case1/input.json"), QStringLiteral("://Issue_298_case1/output.json"), 75.59055118110237 /*seam allowance width*/); -#endif ASSERT_TEST_CASE("Issue 298. Case2", QStringLiteral("://Issue_298_case2/input.json"), @@ -138,16 +137,15 @@ void TST_VAbstractPiece::EquidistantRemoveLoop_data() QStringLiteral("://Issue_548_case1/output.json"), 11.338582677165354 /*seam allowance width (0.3 cm)*/); - // Disabled due to "undefined behavior" problem -#if !defined(Q_OS_WIN) && !defined(Q_CC_CLANG) && !defined(Q_PROCESSOR_X86_64) - QTest::newRow("Issue 548. Case2") << InputPointsIssue548Case2() - << 37.795275590551185 // seam allowance width (1.0 cm) - << OutputPointsIssue548Case2(); + ASSERT_TEST_CASE("Issue 548. Case2", + QStringLiteral("://Issue_548_case2/input.json"), + QStringLiteral("://Issue_548_case2/output.json"), + 37.795275590551185 /*seam allowance width (1.0 cm)*/); - QTest::newRow("Issue 548. Case3") << InputPointsIssue548Case3() - << 75.59055118110237 // seam allowance width (2.0 cm) - << OutputPointsIssue548Case3(); -#endif + ASSERT_TEST_CASE("Issue 548. Case3", + QStringLiteral("://Issue_548_case3/input.json"), + QStringLiteral("://Issue_548_case3/output.json"), + 75.59055118110237 /*seam allowance width (2.0 cm)*/); // See file src/app/share/collection/bugs/Issue_#646.val ASSERT_TEST_CASE("Issue 646.", @@ -343,11 +341,23 @@ void TST_VAbstractPiece::LayoutAllowanceRemoveLoop_data() QStringLiteral("://smart_pattern_#58/output.json"), 18.897637795275593 /*seam allowance width (0.5 cm)*/); - // See file src/app/share/collection/test/smart_pattern_#99.val + // See file src/app/share/collection/bugs/smart_pattern_#99.val ASSERT_TEST_CASE("Incorrect fix of distortion", QStringLiteral("://smart_pattern_#99/input.json"), QStringLiteral("://smart_pattern_#99/output.json"), 28.346456692913389 /*seam allowance width*/); + + // See file src/app/share/collection/test/smart_pattern_#120.val (private collection) + ASSERT_TEST_CASE("Piece 1", + QStringLiteral("://smart_pattern_#120_piece_1/input.json"), + QStringLiteral("://smart_pattern_#120_piece_1/output.json"), + 37.795275590551185); + + // See file src/app/share/collection/test/smart_pattern_#120.val (private collection) + ASSERT_TEST_CASE("Piece 2", + QStringLiteral("://smart_pattern_#120_piece_2/input.json"), + QStringLiteral("://smart_pattern_#120_piece_2/output.json"), + 37.795275590551185); } //--------------------------------------------------------------------------------------------------------------------- @@ -374,6 +384,39 @@ void TST_VAbstractPiece::SumTrapezoids() const Case5(); } +//--------------------------------------------------------------------------------------------------------------------- +void TST_VAbstractPiece::RawPathRemoveLoop_data() const +{ + QTest::addColumn>("path"); + QTest::addColumn>("expect"); + + auto ASSERT_TEST_CASE = [this](const char *title, const QString &input, const QString &output) + { + QVector inputPoints; + AbstractTest::VectorFromJson(input, inputPoints); + + QVector outputPoints; + AbstractTest::VectorFromJson(output, outputPoints); + + QTest::newRow(title) << inputPoints << outputPoints; + }; + + // See file src/app/share/collection/bugs/smart_pattern_#112.val (private collection) + ASSERT_TEST_CASE("Loop intersection", + QStringLiteral("://smart_pattern_#112/input.json"), + QStringLiteral("://smart_pattern_#112/output.json")); +} + +//--------------------------------------------------------------------------------------------------------------------- +void TST_VAbstractPiece::RawPathRemoveLoop() const +{ + QFETCH(QVector, path); + QFETCH(QVector, expect); + + QVector res = VAbstractPiece::CheckLoops(path); + Comparison(res, expect); +} + //--------------------------------------------------------------------------------------------------------------------- void TST_VAbstractPiece::PathRemoveLoop_data() const { @@ -420,11 +463,6 @@ void TST_VAbstractPiece::PathRemoveLoop_data() const res << QPointF(20, 10); QTest::newRow("One loop, closed a path (four unique points)") << path << res; - path.removeLast(); - res.removeLast(); - - QTest::newRow("One loop, unclosed a path (four unique points)") << path << res; - path.clear(); path << QPointF(20, 10); path << QPointF(20, 20); @@ -441,11 +479,6 @@ void TST_VAbstractPiece::PathRemoveLoop_data() const res << QPointF(20, 10); QTest::newRow("Two loops, closed a path (six unique points)") << path << res; - path.removeLast(); - res.removeLast(); - - QTest::newRow("Two loops, unclosed a path (six unique points)") << path << res; - path.clear(); path << QPointF(20, 10); path << QPointF(20, 20); @@ -462,10 +495,6 @@ void TST_VAbstractPiece::PathRemoveLoop_data() const res << QPointF(20, 10); QTest::newRow("One loop, the first loop, closed a path (six unique points)") << path << res; - path.removeLast(); - res.removeLast(); - QTest::newRow("One loop, the first loop, unclosed a path (six unique points)") << path << res; - path.clear(); path << QPointF(20, 10); path << QPointF(20, 20); @@ -865,91 +894,6 @@ void TST_VAbstractPiece::BrokenDetailEquidistant_data() QTest::newRow(title) << inputPoints << width << outputPoints; }; - // For more details see the file "collection/bugs/GAVAUDAN Laure - corsage - figure 4.val". - // We will test only one detail. The second require too accurate data that we cannot get from debuger. - // The test check an open equdistant of correct detail. - QVector points;// Input points. - - VSAPoint p = VSAPoint(787.5835464566929, 1701.3138897637796); - p.SetSAAfter(-1); - p.SetSABefore(0); - points.append(p); - - p = VSAPoint(863.1740976377953, 1701.3138897637796); - p.SetSAAfter(-1); - p.SetSAAfter(-1); - points.append(p); - - points.append(VSAPoint(938.7646488188976, 1701.3138897637796)); - points.append(VSAPoint(928.6149944255945, 1732.4440762118775)); - points.append(VSAPoint(910.0209054382323, 1792.3369946802652)); - points.append(VSAPoint(893.3643210561819, 1849.7845240486258)); - points.append(VSAPoint(878.5243977752426, 1905.2261712206746)); - points.append(VSAPoint(865.3802920912136, 1959.1014431001254)); - points.append(VSAPoint(853.8111604998944, 2011.8498465906928)); - points.append(VSAPoint(843.6961594970844, 2063.910888596092)); - points.append(VSAPoint(834.9144455785826, 2115.7240760200366)); - points.append(VSAPoint(827.3451752401882, 2167.7289157662426)); - points.append(VSAPoint(820.8675049777007, 2220.364914738423)); - points.append(VSAPoint(815.3605912869193, 2274.0715798402925)); - points.append(VSAPoint(810.703590663643, 2329.2884179755656)); - points.append(VSAPoint(806.7756596036716, 2386.454936047957)); - points.append(VSAPoint(803.455954602804, 2446.0106409611817)); - points.append(VSAPoint(800.6236321568394, 2508.395039618954)); - points.append(VSAPoint(798.1578487615775, 2574.047638924988)); - points.append(VSAPoint(797.0323653543306, 2608.4005039370077)); - points.append(VSAPoint(929.3158299212598, 2608.4005039370077)); - points.append(VSAPoint(927.9285659612306, 2548.9599884455793)); - points.append(VSAPoint(925.157717598664, 2463.8329634071292)); - points.append(VSAPoint(922.7222742526749, 2408.6782012856274)); - points.append(VSAPoint(919.6220036804666, 2354.5469017384876)); - points.append(VSAPoint(915.706969354324, 2301.1170261784787)); - points.append(VSAPoint(910.8272347465313, 2248.066536018368)); - points.append(VSAPoint(904.8328633293736, 2195.073392670922)); - points.append(VSAPoint(897.5739185751353, 2141.8155575489095)); - points.append(VSAPoint(888.9004639561011, 2087.9709920650976)); - points.append(VSAPoint(878.6625629445558, 2033.2176576322527)); - points.append(VSAPoint(866.7102790127839, 1977.233515663143)); - points.append(VSAPoint(852.8936756330698, 1919.696527570536)); - points.append(VSAPoint(837.0628162776984, 1860.284654767199)); - points.append(VSAPoint(819.0677644189545, 1798.675858665899)); - points.append(VSAPoint(798.7585835291225, 1734.548100679404)); - points.append(VSAPoint(787.5835464566929, 1701.3138897637796)); - - p = VSAPoint(797.0323653543306, 2608.4005039370077); - p.SetSAAfter(0); - p.SetSABefore(-1); - points.append(p); - - QVector ekvOrig; - ekvOrig.append(QPointF(787.1898456692913, 1663.5186141732283)); - ekvOrig.append(QPointF(863.1740976377953, 1663.5186141732283)); - ekvOrig.append(QPointF(990.8407796109454, 1663.5186141732283)); - ekvOrig.append(QPointF(964.6314897747087, 1743.9055956070622)); - ekvOrig.append(QPointF(946.222111945205, 1803.203545947388)); - ekvOrig.append(QPointF(929.7733236875301, 1859.9343993344141)); - ekvOrig.append(QPointF(915.1430683369846, 1914.5927314447797)); - ekvOrig.append(QPointF(902.2033477151627, 1967.6302665424967)); - ekvOrig.append(QPointF(890.8261161082305, 2019.5037195040304)); - ekvOrig.append(QPointF(880.8841829577946, 2070.673996127427)); - ekvOrig.append(QPointF(872.2520522462703, 2121.604624314014)); - ekvOrig.append(QPointF(864.8064761358401, 2172.759620123457)); - ekvOrig.append(QPointF(864.2562272534083, 2177.2308109121955)); - ekvOrig.append(QPointF(860.1867773842832, 2147.3738416825267)); - ekvOrig.append(QPointF(851.6617474319463, 2094.450692409028)); - ekvOrig.append(QPointF(841.5996933370075, 2040.6378051462616)); - ekvOrig.append(QPointF(829.8479530577714, 1985.5930036729653)); - ekvOrig.append(QPointF(828.2738301865061, 1979.0378260789357)); - ekvOrig.append(QPointF(834.4319111572987, 2570.213599275029)); - ekvOrig.append(QPointF(796.554931640625, 2597.28125)); - ekvOrig.append(QPointF(787.1898456692913, 1663.5186141732283)); - - // Disabled due to "undefined behavior" problem -#if !defined(Q_OS_WIN) && !defined(Q_CC_CLANG) && !defined(Q_PROCESSOR_X86_64) && !defined(Q_PROCESSOR_S390) \ - && !defined(Q_PROCESSOR_S390_X) - QTest::newRow("GAVAUDAN Laure.") << points << 37.795275590551185 << ekvOrig; -#endif - // See the file "collection/bugs/Issue_#604.val" (since 0.5.0) ASSERT_TEST_CASE("Issue #604.", QStringLiteral("://Issue_604/input.json"), @@ -962,13 +906,11 @@ void TST_VAbstractPiece::BrokenDetailEquidistant_data() QStringLiteral("://Issue_627/output.json"), 56.692913385826778 /*seam allowance width*/); -#if !defined (Q_PROCESSOR_S390) && !defined(Q_PROCESSOR_S390_X) // See the file "collection/bugs/Issue_#687.val" ASSERT_TEST_CASE("Issue #687.", QStringLiteral("://Issue_687/input.json"), QStringLiteral("://Issue_687/output.json"), 37.795275590551185 /*seam allowance width*/); -#endif // See private test cases in file jacket_issue_#767.val, piece "Fabric_TopCollar" // Curve approximation scale 0.5 @@ -1099,6 +1041,18 @@ void TST_VAbstractPiece::EquidistantAngleType_data() QStringLiteral("://panties_case2/input.json"), QStringLiteral("://panties_case2/output.json"), 26.45669291338583 /*seam allowance width*/); + + // See file src/app/share/collection/bugs/smart_pattern_#113.val (private collection) + ASSERT_TEST_CASE("Эдит 6", + QStringLiteral("://smart_pattern_#113/input.json"), + QStringLiteral("://smart_pattern_#113/output.json"), + 0.56692913385826771 /*seam allowance width*/); + + // See file src/app/share/collection/bugs/smart_pattern_#118.val (private collection) + ASSERT_TEST_CASE("Ретро стринги 3", + QStringLiteral("://smart_pattern_#118/input.json"), + QStringLiteral("://smart_pattern_#118/output.json"), + 26.45669291338583 /*seam allowance width*/); } //--------------------------------------------------------------------------------------------------------------------- @@ -1189,7 +1143,6 @@ void TST_VAbstractPiece::TestCorrectEquidistantPoints() const Comparison(after, expect); } -#ifndef Q_OS_WIN //--------------------------------------------------------------------------------------------------------------------- void TST_VAbstractPiece::PossibleInfiniteClearLoops_data() const { @@ -1306,7 +1259,6 @@ void TST_VAbstractPiece::PossibleInfiniteClearLoops() const QVector res = VAbstractPiece::CheckLoops(path); Comparison(res, expect); } -#endif //#ifndef Q_OS_WIN //--------------------------------------------------------------------------------------------------------------------- void TST_VAbstractPiece::Case3() const @@ -1335,64 +1287,6 @@ void TST_VAbstractPiece::Case5() const QVERIFY(qFuzzyIsNull(result)); } -//--------------------------------------------------------------------------------------------------------------------- -QVector TST_VAbstractPiece::InputPointsIssue548Case2() const -{ - QVector points; - points << VSAPoint(99.86433649395013, 10.166060970128015); - points << VSAPoint(176.0178302829931, 57.36978169486653); - points << VSAPoint(115.46606095399079, 156.67924434657942); - points << VSAPoint(197.43414263641347, 70.64467660756823); - points << VSAPoint(247.18110236220474, 101.48031496062993); - points << VSAPoint(29.858267716535437, 300.85039370078744); - - return points; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector TST_VAbstractPiece::OutputPointsIssue548Case2() const -{ - QVector points; - points << QPointF(75.35612582031402, -49.49247429729551); - points << QPointF(207.99390662262346, 32.7230151178754); - points << QPointF(309.47290565612207, 95.62474281894228); - points << QPointF(34.78597607721976, 347.62014343263024); - points << QPointF(-13.438975506560153, 319.209057294505); - points << QPointF(75.35612582031402, -49.49247429729551); - - return points; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector TST_VAbstractPiece::InputPointsIssue548Case3() const -{ - QVector points; - - points += VSAPoint(99.86433649395013, 10.166060970128015); - points += VSAPoint(176.0178302829931, 57.36978169486653); - points += VSAPoint(115.46606095399079, 156.67924434657942); - points += VSAPoint(197.43414263641347, 70.64467660756823); - points += VSAPoint(247.18110236220474, 101.48031496062993); - points += VSAPoint(29.858267716535437, 300.85039370078744); - - return points; -} - -//--------------------------------------------------------------------------------------------------------------------- -QVector TST_VAbstractPiece::OutputPointsIssue548Case3() const -{ - QVector points; - - points += QPointF(50.84791514667799, -109.15100956471929); - points += QPointF(220.96071459087483, -3.7066408675763003); - points += QPointF(371.76470895003956, 89.76917067725468); - points += QPointF(39.71368443790398, 394.38989316447305); - points += QPointF(-56.73621872965576, 337.56772088822254); - points += QPointF(50.84791514667799, -109.15100956471929); - - return points; -} - //--------------------------------------------------------------------------------------------------------------------- QVector TST_VAbstractPiece::InputPointsCase3a() const { diff --git a/src/test/ValentinaTest/tst_vabstractpiece.h b/src/test/ValentinaTest/tst_vabstractpiece.h index 157c068c2..0fceca326 100644 --- a/src/test/ValentinaTest/tst_vabstractpiece.h +++ b/src/test/ValentinaTest/tst_vabstractpiece.h @@ -45,6 +45,8 @@ private slots: void LayoutAllowanceRemoveLoop_data(); void LayoutAllowanceRemoveLoop() const; void SumTrapezoids() const; + void RawPathRemoveLoop_data() const; + void RawPathRemoveLoop() const; void PathRemoveLoop_data() const; void PathRemoveLoop() const; void PathLoopsCase_data() const; @@ -57,10 +59,8 @@ private slots: void CorrectEquidistantPoints() const; void TestCorrectEquidistantPoints_data(); void TestCorrectEquidistantPoints() const; -#ifndef Q_OS_WIN // Disabled due to "undefined behavior" problem void PossibleInfiniteClearLoops_data() const; void PossibleInfiniteClearLoops() const; -#endif private: QVector InputPointsCase3() const; @@ -70,12 +70,6 @@ private: void Case4() const; void Case5() const; - QVector InputPointsIssue548Case2() const; - QVector OutputPointsIssue548Case2() const; - - QVector InputPointsIssue548Case3() const; - QVector OutputPointsIssue548Case3() const; - QVector InputPointsCase3a() const; QVector InputPointsCase4a() const; QVector InputPointsCase5a() const; diff --git a/src/test/ValentinaTest/tst_varc.cpp b/src/test/ValentinaTest/tst_varc.cpp index 61752b5c1..0ef8b1a7e 100644 --- a/src/test/ValentinaTest/tst_varc.cpp +++ b/src/test/ValentinaTest/tst_varc.cpp @@ -454,5 +454,5 @@ void TST_VArc::TestCurveIntersectAxis() const bool found = VAbstractCurve::CurveIntersectAxis(basePoint, angle, curvePoints, &intersectionPoint); QCOMPARE(found, result); - Comparison(intersectionPoint, crosPoint); + Comparison(intersectionPoint, crosPoint, accuracyPointOnLine); } diff --git a/src/test/ValentinaTest/tst_vellipticalarc.cpp b/src/test/ValentinaTest/tst_vellipticalarc.cpp index fc872ac32..938b00033 100644 --- a/src/test/ValentinaTest/tst_vellipticalarc.cpp +++ b/src/test/ValentinaTest/tst_vellipticalarc.cpp @@ -34,7 +34,7 @@ #include //--------------------------------------------------------------------------------------------------------------------- -TST_VEllipticalArc::TST_VEllipticalArc(QObject *parent) : QObject(parent) +TST_VEllipticalArc::TST_VEllipticalArc(QObject *parent) : AbstractTest(parent) {} //--------------------------------------------------------------------------------------------------------------------- @@ -168,7 +168,7 @@ void TST_VEllipticalArc::TestData() QTest::newRow("Full circle: radiuses 150, 200, rotation 30; start 0") << 150.0 << 200.0 << 0.0 << 360.0 << 30.0; QTest::newRow("Full circle: radiuses 1500, 1000; start 0") << 1500.0 << 1000.0 << 0.0 << 360.0 << 0.0; QTest::newRow("Full circle: radiuses 1500, 1000, rotation 50; start 0") << 1500.0 << 1000.0 << 0.0 << 360.0 << 50.0; - QTest::newRow("Full circle: radiuses 90000, 80000, rotation 90; start 0") << 90000.0 << 80000.0 << 0.0 << 360.0 + QTest::newRow("Full circle: radiuses 15000, 10000, rotation 90; start 0") << 15000.0 << 10000.0 << 0.0 << 360.0 << 90.0; QTest::newRow("Full circle: radiuses 10, 20; start 90") << 10.0 << 20.0 << 90.0 << 90.0 << 0.0; @@ -177,21 +177,21 @@ void TST_VEllipticalArc::TestData() QTest::newRow("Full circle: radiuses 1500, 1000; start 90") << 1500.0 << 1000.0 << 90.0 << 90.0 << 0.0; QTest::newRow("Full circle: radiuses 1500, 1000, rotation 50; start 90") << 1500.0 << 1000.0 << 90.0 << 90.0 << 50.0; - QTest::newRow("Full circle: radiuses 90000, 80000, rotation 90; start 90") << 90000.0 << 80000.0 << 90.0 << 90.0 + QTest::newRow("Full circle: radiuses 15000, 10000, rotation 90; start 90") << 15000.0 << 10000.0 << 90.0 << 90.0 << 90.0; QTest::newRow("Arc less than 45 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 10.5 << 0.0; QTest::newRow("Arc less than 45 degree, radiuses 150, 50, rotation 180") << 150.0 << 50.0 << 0.0 << 10.5 << 180.0; QTest::newRow("Arc less than 45 degree, radiuses 1500, 800, rotation 90") << 1500.0 << 800.0 << 0.0 << 10.5 << 90.0; - QTest::newRow("Arc less than 45 degree, radiuses 50000, 10000, rotation 40") + QTest::newRow("Arc less than 45 degree, radiuses 15000, 10000, rotation 40") << 50000.0 << 10000.0 << 0.0 << 10.5 << 40.0; - QTest::newRow("Arc less than 45 degree, radiuses 90000, 10000") << 90000.0 << 10000.0 << 0.0 << 10.5 << 0.0; + QTest::newRow("Arc less than 45 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 10.5 << 0.0; QTest::newRow("Arc 45 degree, radiuses 100, 50, rotation 45") << 100.0 << 50.0 << 0.0 << 45.0 << 45.0; QTest::newRow("Arc 45 degree, radiuses 150, 15, rotation 30") << 150.0 << 15.0 << 0.0 << 45.0 << 30.0; QTest::newRow("Arc 45 degree, radiuses 1500, 150, rotation 45") << 1500.0 << 150.0 << 0.0 << 45.0 << 45.0; - QTest::newRow("Arc 45 degree, radiuses 50000, 50000") << 50000.0 << 50000.0 << 0.0 << 45.0 << 0.0; - QTest::newRow("Arc 45 degree, radiuses 90000, 50000, rotation 270") << 90000.0 << 50000.0 << 0.0 << 45.0 << 270.0; + QTest::newRow("Arc 45 degree, radiuses 15000, 15000") << 15000.0 << 15000.0 << 0.0 << 45.0 << 0.0; + QTest::newRow("Arc 45 degree, radiuses 15000, 10000, rotation 270") << 15000.0 << 10000.0 << 0.0 << 45.0 << 270.0; QTest::newRow("Arc less than 90 degree, radiuses 100, 400, rotation 50") << 100.0 << 400.0 << 0.0 << 75.0 << 50.0; QTest::newRow("Arc less than 90 degree, radiuses 150, 400, rotation 90") << 150.0 << 400.0 << 0.0 << 75.0 << 90.0; @@ -205,65 +205,65 @@ void TST_VEllipticalArc::TestData() QTest::newRow("Arc 90 degree, radiuses 100, 50, rotation 30") << 100.0 << 50.0 << 0.0 << 90.0 << 30.0; QTest::newRow("Arc 90 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 90.0 << 0.0; QTest::newRow("Arc 90 degree, radiuses 1500, 800, rotation 70") << 1500.0 << 800.0 << 0.0 << 90.0 << 70.0; - QTest::newRow("Arc 90 degree, radiuses 50000, 5000, rotation 30") << 50000.0 << 5000.0 << 0.0 << 90.0 << 30.0; - QTest::newRow("Arc 90 degree, radiuses 90000, 50000, rotation 235") << 90000.0 << 50000.0 << 0.0 << 90.0 << 235.0; + QTest::newRow("Arc 90 degree, radiuses 15000, 5000, rotation 30") << 15000.0 << 1500.0 << 0.0 << 90.0 << 30.0; + QTest::newRow("Arc 90 degree, radiuses 15000, 14000, rotation 235") << 15000.0 << 14000.0 << 0.0 << 90.0 << 235.0; QTest::newRow("Arc less than 135 degree, radiuses 100, 50, rotation 60") << 100.0 << 50.0 << 0.0 << 110.6 << 60.0; QTest::newRow("Arc less than 135 degree, radiuses 150, 400, rotation 300") << 150.0 << 400.0 << 0.0 << 110.6 << 300.0; QTest::newRow("Arc less than 135 degree, radiuses 1500, 800, rotation 360") << 1500.0 << 800.0 << 0.0 << 110.6 << 360.0; - QTest::newRow("Arc less than 135 degree, radiuses 50000, 5000, rotation 290") - << 50000.0 << 5000.0 << 0.0 << 110.6 << 290.0; - QTest::newRow("Arc less than 135 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 110.6 << 0.0; + QTest::newRow("Arc less than 135 degree, radiuses 15000, 1500, rotation 290") + << 15000.0 << 1500.0 << 0.0 << 110.6 << 290.0; + QTest::newRow("Arc less than 135 degree, radiuses 15000, 1500") << 15000.0 << 1500.0 << 0.0 << 110.6 << 0.0; QTest::newRow("Arc 135 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 135.0 << 0.0; QTest::newRow("Arc 135 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 135.0 << 0.0; QTest::newRow("Arc 135 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 135.0 << 0.0; - QTest::newRow("Arc 135 degree, radiuses 50000, 5000, rotation 20") << 50000.0 << 5000.0 << 0.0 << 135.0 << 20.0; - QTest::newRow("Arc 135 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 135.0 << 0.0; + QTest::newRow("Arc 135 degree, radiuses 15000, 1500, rotation 20") << 15000.0 << 1500.0 << 0.0 << 135.0 << 20.0; + QTest::newRow("Arc 135 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 135.0 << 0.0; QTest::newRow("Arc less than 180 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 160.7 << 0.0; QTest::newRow("Arc less than 180 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 160.7 << 0.0; QTest::newRow("Arc less than 180 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 160.7 << 0.0; - QTest::newRow("Arc less than 180 degree, radiuses 50000, 5000, rotation 270") - << 50000.0 << 5000.0 << 0.0 << 160.7 << 270.0; - QTest::newRow("Arc less than 180 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 160.7 << 0.0; + QTest::newRow("Arc less than 180 degree, radiuses 15000, 1500, rotation 270") + << 15000.0 << 1500.0 << 0.0 << 160.7 << 270.0; + QTest::newRow("Arc less than 180 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 160.7 << 0.0; QTest::newRow("Arc 180 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 180.0 << 0.0; QTest::newRow("Arc 180 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 180.0 << 0.0; QTest::newRow("Arc 180 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 180.0 << 0.0; - QTest::newRow("Arc 180 degree, radiuses 50000, 5000, rotation 60") << 50000.0 << 5000.0 << 0.0 << 180.0 << 60.0; - QTest::newRow("Arc 180 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 180.0 << 0.0; + QTest::newRow("Arc 180 degree, radiuses 15000, 1500, rotation 60") << 15000.0 << 1500.0 << 0.0 << 180.0 << 60.0; + QTest::newRow("Arc 180 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 180.0 << 0.0; QTest::newRow("Arc less than 270 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 150.3 << 0.0; QTest::newRow("Arc less than 270 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 150.3 << 0.0; QTest::newRow("Arc less than 270 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 150.3 << 0.0; - QTest::newRow("Arc less than 270 degree, radiuses 50000, 5000, rotation 20") - << 50000.0 << 5000.0 << 0.0 << 150.3 << 20.0; - QTest::newRow("Arc less than 270 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 150.3 << 0.0; + QTest::newRow("Arc less than 270 degree, radiuses 15000, 1500, rotation 20") + << 15000.0 << 1500.0 << 0.0 << 150.3 << 20.0; + QTest::newRow("Arc less than 270 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 150.3 << 0.0; QTest::newRow("Arc 270 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 270.0 << 0.0; QTest::newRow("Arc 270 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 270.0 << 0.0; QTest::newRow("Arc 270 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 270.0 << 0.0; - QTest::newRow("Arc 270 degree, radiuses 50000, 5000, rotation 90") << 50000.0 << 5000.0 << 0.0 << 270.0 << 90.0; - QTest::newRow("Arc 270 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 270.0 << 0.0; + QTest::newRow("Arc 270 degree, radiuses 15000, 1500, rotation 90") << 15000.0 << 1500.0 << 0.0 << 270.0 << 90.0; + QTest::newRow("Arc 270 degree, radiuses 15000, 10000") << 15000.0 << 10000.0 << 0.0 << 270.0 << 0.0; QTest::newRow("Arc less than 360 degree, radiuses 100, 50") << 100.0 << 50.0 << 0.0 << 340.0 << 0.0; QTest::newRow("Arc less than 360 degree, radiuses 150, 400") << 150.0 << 400.0 << 0.0 << 340.0 << 0.0; QTest::newRow("Arc less than 360 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 0.0 << 340.0 << 0.0; - QTest::newRow("Arc less than 360 degree, radiuses 50000, 5000, rotation 30") - << 50000.0 << 5000.0 << 0.0 << 340.0 << 30.0; - QTest::newRow("Arc less than 360 degree, radiuses 90000, 50000") << 90000.0 << 50000.0 << 0.0 << 340.0 << 0.0; + QTest::newRow("Arc less than 360 degree, radiuses 12000, 1200, rotation 30") + << 12000.0 << 1200.0 << 0.0 << 340.0 << 30.0; + QTest::newRow("Arc less than 360 degree, radiuses 12000, 10000") << 15000.0 << 10000.0 << 0.0 << 340.0 << 0.0; QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 100, 50") << 100.0 << 50.0 << 90.0 << 135.0 << 0.0; QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 150, 400") << 150.0 << 400.0 << 90.0 << 135.0 << 0.0; QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 1500, 800") << 1500.0 << 800.0 << 90.0 << 135.0 << 0.0; - QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 50000, 5000") - << 50000.0 << 5000.0 << 90.0 << 135.0 << 0.0; - QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 90000, 50000") - << 90000.0 << 50000.0 << 90.0 << 135.0 << 0.0; + QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 13000, 1000") + << 15000.0 << 1000.0 << 90.0 << 135.0 << 0.0; + QTest::newRow("Arc start 90 degree, angle 45 degree, radiuses 15000, 10000") + << 15000.0 << 10000.0 << 90.0 << 135.0 << 0.0; } //--------------------------------------------------------------------------------------------------------------------- @@ -460,6 +460,23 @@ void TST_VEllipticalArc::TestGetPoints5() QCOMPARE(f1, stAngle); QCOMPARE(f2, enAngle); + + QVector points = arc.GetPoints(); + + if (points.size() > 2 && qFuzzyIsNull(rotationAngle)) + { + const qreal testAccuracy = (1.5/*mm*/ / 25.4) * PrintDPI; + Comparison(arc.GetP1(), ConstFirst(points), testAccuracy); + Comparison(arc.GetP2(), ConstLast(points), testAccuracy); + + const qreal eps = 0.15; + + f1 = QLineF(static_cast(center), ConstFirst(points)).angle(); + QVERIFY2(f1 - stAngle <= eps, qUtf8Printable(QStringLiteral("f1: %1; expected: %2").arg(f1).arg(stAngle))); + + f2 = QLineF(static_cast(center), ConstLast(points)).angle(); + QVERIFY2(f2 - enAngle <= eps, qUtf8Printable(QStringLiteral("f2: %1; expected: %2").arg(f2).arg(enAngle))); + } } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/test/ValentinaTest/tst_vellipticalarc.h b/src/test/ValentinaTest/tst_vellipticalarc.h index 3c795e8c3..99f4486dc 100644 --- a/src/test/ValentinaTest/tst_vellipticalarc.h +++ b/src/test/ValentinaTest/tst_vellipticalarc.h @@ -29,9 +29,9 @@ #ifndef TST_VELLIPTICALARC_H #define TST_VELLIPTICALARC_H -#include +#include "../vtest/abstracttest.h" -class TST_VEllipticalArc : public QObject +class TST_VEllipticalArc : public AbstractTest { Q_OBJECT public: